We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2d79d97 commit d594417Copy full SHA for d594417
1 file changed
src/render_html.js
@@ -35,6 +35,11 @@ function highlight(lang, text) {
35
return result
36
}
37
38
+function maybeSplitInlineCode(html) {
39
+ if (html.length <= 16) return html
40
+ return html.replace(/[.\/](?!\/)/, "$&<wbr>")
41
+}
42
+
43
function anchor(token) {
44
return token.hashID ? `<a class="${token.hashID.charAt(0)}_ident" id="${token.hashID}" href="#${token.hashID}"></a>` : ""
45
@@ -88,7 +93,7 @@ let renderer = {
88
93
89
94
html_block(token) { return token.content },
90
95
91
- code_inline(token) { return `<code>${escape(token.content)}</code>` },
96
+ code_inline(token) { return `<code>${maybeSplitInlineCode(escape(token.content))}</code>` },
92
97
98
strong_open() { return "<strong>" },
99
strong_close() { return "</strong>" },
0 commit comments