mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-26 03:27:18 +00:00
Fixes Text Parser being impacted by overrides to codeblock widget (#7844)
* fix: overriding codeblock widget should not impact text parser * fix: whitespace changes
This commit is contained in:
parent
e4bf7c5f44
commit
bf8b3cff03
@ -14,10 +14,12 @@ The plain text parser processes blocks of source text into a degenerate parse tr
|
|||||||
|
|
||||||
var TextParser = function(type,text,options) {
|
var TextParser = function(type,text,options) {
|
||||||
this.tree = [{
|
this.tree = [{
|
||||||
type: "codeblock",
|
type: "genesis",
|
||||||
attributes: {
|
attributes: {
|
||||||
code: {type: "string", value: text},
|
$type: {name: "$type", type: "string", value: "$codeblock"},
|
||||||
language: {type: "string", value: type}
|
code: {name: "code", type: "string", value: text},
|
||||||
|
language: {name: "language", type: "string", value: type},
|
||||||
|
$remappable: {name: "$remappable", type:"string", value: "no"}
|
||||||
}
|
}
|
||||||
}];
|
}];
|
||||||
this.source = text;
|
this.source = text;
|
||||||
@ -32,4 +34,3 @@ exports["text/css"] = TextParser;
|
|||||||
exports["application/x-tiddler-dictionary"] = TextParser;
|
exports["application/x-tiddler-dictionary"] = TextParser;
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
@ -0,0 +1,20 @@
|
|||||||
|
title: Transclude/CustomWidget/CodeblockOverride-TextParser
|
||||||
|
description: Test that overriding codeblock widget does not impact text parser
|
||||||
|
type: text/vnd.tiddlywiki-multiple
|
||||||
|
tags: [[$:/tags/wiki-test-spec]]
|
||||||
|
|
||||||
|
title: Output
|
||||||
|
|
||||||
|
\whitespace trim
|
||||||
|
\widget $codeblock(code)
|
||||||
|
<$transclude $variable="copy-to-clipboard" src=<<code>>/>
|
||||||
|
<$genesis $type="$codeblock" $remappable="no" code=<<code>>/>
|
||||||
|
\end
|
||||||
|
|
||||||
|
\procedure myvariable() hello
|
||||||
|
|
||||||
|
<$transclude $variable="myvariable" $type="text/plain" $output="text/plain"/>
|
||||||
|
+
|
||||||
|
title: ExpectedResult
|
||||||
|
|
||||||
|
<p>hello</p>
|
Loading…
Reference in New Issue
Block a user