File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -109,6 +109,12 @@ export const unsafe = [
109109 inConstruct : 'phrasing' ,
110110 notInConstruct : fullPhrasingSpans
111111 } ,
112+ {
113+ character : '<' ,
114+ before : '(?:[ \t\r\n]|$)' ,
115+ inConstruct : 'phrasing' ,
116+ notInConstruct : fullPhrasingSpans
117+ } ,
112118 { character : '<' , inConstruct : 'destinationLiteral' } ,
113119 // An equals to can start setext heading underlines.
114120 { atBreak : true , character : '=' } ,
Original file line number Diff line number Diff line change @@ -3932,6 +3932,26 @@ test('escape', async function (t) {
39323932 )
39333933 } )
39343934
3935+ await t . test (
3936+ 'should escape what would otherwise be html (2)' ,
3937+ async function ( ) {
3938+ assert . equal (
3939+ to ( { type : 'paragraph' , children : [ { type : 'text' , value : '<1%' } ] } ) ,
3940+ '\\<1%\n'
3941+ )
3942+ }
3943+ )
3944+
3945+ await t . test (
3946+ 'dont escape a less-than sign that cant be a tag open' ,
3947+ async function ( ) {
3948+ assert . equal (
3949+ to ( { type : 'paragraph' , children : [ { type : 'text' , value : 'm<1%' } ] } ) ,
3950+ 'm<1%\n'
3951+ )
3952+ }
3953+ )
3954+
39353955 await t . test (
39363956 'should escape what would otherwise be code (text)' ,
39373957 async function ( ) {
You can’t perform that action at this time.
0 commit comments