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 = [
109
109
inConstruct : 'phrasing' ,
110
110
notInConstruct : fullPhrasingSpans
111
111
} ,
112
+ {
113
+ character : '<' ,
114
+ before : '(?:[ \t\r\n]|$)' ,
115
+ inConstruct : 'phrasing' ,
116
+ notInConstruct : fullPhrasingSpans
117
+ } ,
112
118
{ character : '<' , inConstruct : 'destinationLiteral' } ,
113
119
// An equals to can start setext heading underlines.
114
120
{ atBreak : true , character : '=' } ,
Original file line number Diff line number Diff line change @@ -3932,6 +3932,26 @@ test('escape', async function (t) {
3932
3932
)
3933
3933
} )
3934
3934
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
+
3935
3955
await t . test (
3936
3956
'should escape what would otherwise be code (text)' ,
3937
3957
async function ( ) {
You can’t perform that action at this time.
0 commit comments