File tree Expand file tree Collapse file tree 2 files changed +33
-1
lines changed
Expand file tree Collapse file tree 2 files changed +33
-1
lines changed Original file line number Diff line number Diff line change @@ -980,7 +980,11 @@ var parseInline = function(block) {
980980// Parse string content in block into inline children,
981981// using refmap to resolve references.
982982var parseInlines = function ( block ) {
983- this . subject = block . _string_content . trim ( ) ;
983+ // trim() removes non-ASCII whitespaces, vertical tab, form feed and so on.
984+ // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trim#return_value
985+ // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#white_space
986+ // Removes only ASCII tab and space.
987+ this . subject = block . _string_content . replace ( / ^ [ \t \r \n ] + | [ \t \r \n ] + $ / g, "" )
984988 this . pos = 0 ;
985989 this . delimiters = null ;
986990 this . brackets = null ;
Original file line number Diff line number Diff line change @@ -518,3 +518,31 @@ foo <!-- test --> more -->
518518<p>foo <!-----></p>
519519<p>foo <!-- test --> more --></p>
520520````````````````````````````````
521+
522+ #261
523+ ```````````````````````````````` example
524+ Vertical Tab
525+
526+ Form Feed
527+
528+ NBSP (U+00A0) NBSP
529+
530+ Em Space (U+2003) Em Space
531+
532+
Line Separator (U+2028) Line Separator
533+
534+
Paragraph Separator (U+2029) Paragraph Separator
535+
536+ 全角スペース (U+3000) 全形空白
537+
538+ ZWNBSP (U+FEFF) ZWNBSP
539+ .
540+ <p>Vertical Tab</p>
541+ <p>Form Feed</p>
542+ <p> NBSP (U+00A0) NBSP </p>
543+ <p> Em Space (U+2003) Em Space </p>
544+ <p>
Line Separator (U+2028) Line Separator
</p>
545+ <p>
Paragraph Separator (U+2029) Paragraph Separator
</p>
546+ <p> 全角スペース (U+3000) 全形空白 </p>
547+ <p>ZWNBSP (U+FEFF) ZWNBSP</p>
548+ ````````````````````````````````
You can’t perform that action at this time.
0 commit comments