Mercurial Hosting > luan
changeset 1279:323743a7f317
add html tag.raw
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Tue, 18 Dec 2018 12:54:55 -0700 |
parents | d83f6cc558de |
children | 781ec0a92bb5 |
files | src/luan/modules/parsers/Html.java |
diffstat | 1 files changed, 3 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
diff -r d83f6cc558de -r 323743a7f317 src/luan/modules/parsers/Html.java --- a/src/luan/modules/parsers/Html.java Mon Dec 17 15:40:58 2018 -0700 +++ b/src/luan/modules/parsers/Html.java Tue Dec 18 12:54:55 2018 -0700 @@ -120,7 +120,7 @@ } private LuanTable parseTag() { - parser.begin(); + int tagStart = parser.begin(); if( !parser.match('<') ) return parser.failure(null); int start = parser.currentIndex(); @@ -139,11 +139,13 @@ boolean isEmpty = parser.match('/'); if( !parser.match('>') ) return parser.failure(null); + String raw = parser.textFrom(tagStart); LuanTable tbl = new LuanTable(luan); tbl.rawPut("type","tag"); tbl.rawPut("name",name); tbl.rawPut("attributes",attributes); tbl.rawPut("is_empty",isEmpty); + tbl.rawPut("raw",raw); return parser.success(tbl); }