@@ -222,12 +222,14 @@ public Rule FencedCodeBlock() {
222
222
Var <Integer > markerLength = new Var <Integer >();
223
223
return NodeSequence (
224
224
// vsch: test to see if what appears to be a code fence is just inline code
225
+ // vsch: change to accept code fence with all blank lines
225
226
CodeFence (markerLength ),
226
- TestNot (CodeFence (markerLength )), // prevent empty matches
227
- ZeroOrMore (BlankLine (), text .append ('\n' )),
228
- OneOrMore (TestNot (Newline (), CodeFence (markerLength )), ANY , text .append (matchedChar ())),
229
- Newline (),
230
- push (new VerbatimNode (text .appended ('\n' ).getString (), popAsString ())),
227
+ OneOrMore (
228
+ TestNot (CodeFence (markerLength )),
229
+ ZeroOrMore (TestNot (Newline ()), ANY , text .append (matchedChar ())),
230
+ Sequence (Newline (), text .append (matchedChar ()))
231
+ ),
232
+ push (new VerbatimNode (text .getString (), popAsString ())),
231
233
CodeFence (markerLength ), drop ()
232
234
);
233
235
}
@@ -1461,8 +1463,7 @@ ticks, Sp(),
1461
1463
FirstOf (
1462
1464
Sequence (TestNot ('`' ), Nonspacechar ()),
1463
1465
Sequence (TestNot (ticks ), OneOrMore ('`' )),
1464
- Sequence (TestNot (Sp (), ticks ),
1465
- FirstOf (Spacechar (), Sequence (Newline (), TestNot (BlankLine ()))))
1466
+ Sequence (TestNot (Sp (), ticks ), FirstOf (Spacechar (), Sequence (Newline (), TestNot (BlankLine ()))))
1466
1467
)
1467
1468
),
1468
1469
push (new CodeNode (match ())),
0 commit comments