mirror of
https://github.com/TiddlyWiki/TiddlyWiki5.git
synced 2026-04-26 21:54:41 +00:00
Merging #7866: Add start and end properties to WikiText AST nodes
commit5687d9f44bAuthor: Gk0Wk <nmg_wk@yeah.net> Date: Wed Dec 6 11:33:43 2023 +0800 Fix for html parser commitdf0a1b184eAuthor: Gk0Wk <nmg_wk@yeah.net> Date: Wed Dec 6 02:47:47 2023 +0800 Fix HTML AST node boundary parsing in WikiText commitac8dda0a1aAuthor: Gk0Wk <nmg_wk@yeah.net> Date: Sat Dec 2 13:02:52 2023 +0800 update test-wikitext-parser.js, change for-const-of -to .utils.each, add more range attributes commite2b9a4ed57Author: Gk0Wk <nmg_wk@yeah.net> Date: Wed Nov 29 22:35:39 2023 +0800 Add more start-end range attributes for AST commitd3e62ec56aAuthor: Gk0Wk <nmg_wk@yeah.net> Date: Wed Nov 29 20:45:00 2023 +0800 Add rule attribute for WikiText AST nodes commit4200495055Author: Gk0Wk <nmg_wk@yeah.net> Date: Wed Nov 29 15:48:38 2023 +0800 Add start and end properties to AST nodes for list, codeblock, and all other elements
This commit is contained in:
@@ -33,7 +33,8 @@ exports.parse = function() {
|
||||
// Look for the end marker
|
||||
reEnd.lastIndex = this.parser.pos;
|
||||
var match = reEnd.exec(this.parser.source),
|
||||
text;
|
||||
text,
|
||||
start = this.parser.pos;
|
||||
// Process the text
|
||||
if(match) {
|
||||
text = this.parser.source.substring(this.parser.pos,match.index);
|
||||
@@ -47,7 +48,9 @@ exports.parse = function() {
|
||||
tag: "code",
|
||||
children: [{
|
||||
type: "text",
|
||||
text: text
|
||||
text: text,
|
||||
start: start,
|
||||
end: this.parser.pos
|
||||
}]
|
||||
}];
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user