File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,11 @@ function highlight(lang, text) {
3535 return result
3636}
3737
38+ function maybeSplitInlineCode ( html ) {
39+ if ( html . length <= 16 ) return html
40+ return html . replace ( / [ . \/ ] (? ! \/ ) / , "$&<wbr>" )
41+ }
42+
3843function anchor ( token ) {
3944 return token . hashID ? `<a class="${ token . hashID . charAt ( 0 ) } _ident" id="${ token . hashID } " href="#${ token . hashID } "></a>` : ""
4045}
@@ -88,7 +93,7 @@ let renderer = {
8893
8994 html_block ( token ) { return token . content } ,
9095
91- code_inline ( token ) { return `<code>${ escape ( token . content ) } </code>` } ,
96+ code_inline ( token ) { return `<code>${ maybeSplitInlineCode ( escape ( token . content ) ) } </code>` } ,
9297
9398 strong_open ( ) { return "<strong>" } ,
9499 strong_close ( ) { return "</strong>" } ,
You can’t perform that action at this time.
0 commit comments