Allow newlines within filtered transclusions (#6421)

* Allow newlines within filtered transclusions

* Docs
This commit is contained in:
Jeremy Ruston
2022-02-21 15:28:21 +00:00
committed by GitHub
parent ab3109d84b
commit 5378b45c40
4 changed files with 33 additions and 3 deletions

View File

@@ -119,7 +119,7 @@ describe("WikiText parser tests", function() {
);
});
it("should parse comment in pragma area. Comment will be INVISIBLE", function() {
it("should parse comment in pragma area. Comment will be invisible", function() {
expect(parse("<!-- comment in pragma area -->\n\\define aMacro()\nnothing\n\\end\n")).toEqual(
[ { type : 'set', attributes : { name : { type : 'string', value : 'aMacro' }, value : { type : 'string', value : 'nothing' } }, children : [ ], params : [ ], isMacroDefinition : true } ]
@@ -127,6 +127,19 @@ describe("WikiText parser tests", function() {
);
});
it("should block mode filtered transclusions", function() {
expect(parse("{{{ filter }}}")).toEqual(
[ { type: 'list', attributes: { filter: { type: 'string', value: ' filter ' } }, isBlock: true } ]
);
expect(parse("{{{ fil\nter }}}")).toEqual(
[ { type: 'list', attributes: { filter: { type: 'string', value: ' fil\nter ' } }, isBlock: true } ]
);
});
it("should parse inline macro calls", function() {
expect(parse("<<john>><<paul>><<george>><<ringo>>")).toEqual(