1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-11-22 18:24:51 +00:00

Add parsermode pragma

Fixes #7058
This commit is contained in:
jeremy@jermolene.com
2022-11-23 22:35:32 +00:00
parent 882e040e62
commit 00927d2e13
5 changed files with 125 additions and 2 deletions

View File

@@ -47,6 +47,8 @@ var WikiParser = function(type,text,options) {
this.sourceLength = this.source.length;
// Flag for ignoring whitespace
this.configTrimWhiteSpace = false;
// Parser mode
this.parseAsInline = options.parseAsInline;
// Set current parse position
this.pos = 0;
// Start with empty output
@@ -83,7 +85,7 @@ var WikiParser = function(type,text,options) {
// Parse any pragmas
var topBranch = this.parsePragmas();
// Parse the text into inline runs or blocks
if(options.parseAsInline) {
if(this.parseAsInline) {
topBranch.push.apply(topBranch,this.parseInlineRun());
} else {
topBranch.push.apply(topBranch,this.parseBlocks());