1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-26 19:47:20 +00:00

Remove whitespace immediately after pragmas (#7895)

This is intended to revert some of the behaviour introduced in #7835, see the discussion here: https://github.com/Jermolene/TiddlyWiki5/pull/7888#issuecomment-1856184592
This commit is contained in:
Jeremy Ruston 2023-12-21 10:36:45 +00:00 committed by GitHub
parent 6fa81feeba
commit a3e5ace458
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 98 additions and 0 deletions

View File

@ -216,6 +216,8 @@ WikiParser.prototype.parsePragmas = function() {
subTree[0].children = []; subTree[0].children = [];
currentTreeBranch = subTree[0].children; currentTreeBranch = subTree[0].children;
} }
// Skip whitespace after the pragma
this.skipWhitespace();
} }
return currentTreeBranch; return currentTreeBranch;
}; };

View File

@ -0,0 +1,64 @@
title: Pragmas/WhitespaceAfterPragma
description: parsermode pragma
type: text/vnd.tiddlywiki-multiple
tags: [[$:/tags/wiki-test-spec]]
title: Output
<$wikify name="parsetree" text={{Text}} mode="inline" output="parsetree">
<$text text=<<parsetree>>/>
</$wikify>
+
title: Text
\procedure this-is-a-definition() Something
Now!
+
title: ExpectedResult
<p>
[
{
"type": "set",
"attributes": {
"name": {
"name": "name",
"type": "string",
"value": "this-is-a-definition"
},
"value": {
"name": "value",
"type": "string",
"value": "Something"
}
},
"children": [
{
"type": "text",
"text": "Now!\n",
"start": 48,
"end": 53
}
],
"params": [],
"orderedAttributes": [
{
"name": "name",
"type": "string",
"value": "this-is-a-definition"
},
{
"name": "value",
"type": "string",
"value": "Something"
}
],
"isProcedureDefinition": true
}
]
</p>

View File

@ -0,0 +1,32 @@
title: Pragmas/WhitespaceNoPragma
description: parsermode pragma
type: text/vnd.tiddlywiki-multiple
tags: [[$:/tags/wiki-test-spec]]
title: Output
<$wikify name="parsetree" text={{Text}} mode="inline" output="parsetree">
<$text text=<<parsetree>>/>
</$wikify>
+
title: Text
Now!
+
title: ExpectedResult
<p>
[
{
"type": "text",
"text": "\n\n\n\nNow!\n",
"start": 0,
"end": 9
}
]
</p>