Tucker McKnight <tucker@pangolin.lan> | Sun Jan 25 2026
Fix bug where escaped html characters were showing up on commit page The diff was showing escaped < and > characters instead of showing the actual characters in the code. This was happening because we needed to wrap the code string in an m.trust() call so that mithril wouldn't automatically escape the contents of the string. Additionally, I hadn't put newlines in between the line numbers when I changed this page to a mithril template, so I've done that now.
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
m('div', {class: "flex-grow-1 diff-left pe-2"}, [
m('span', {class: 'font-monospace text-secondary'}, 'Before'),
m('div', {class: "row"}, [
m('div', {class: "col-auto border-end"}, m('pre', {class: "mb-0"}, lineNumbers(hunk.beforeText).map((lineNumber) => {
return (lineNumber + hunk.lineNumber - 1).toString()
}))),
m('div', {class: "col overflow-scroll"},
m('pre', {class: "mb-0", 'data-start': hunk.lineNumber}, m('code', {'data-type': 'before', class: `line-numbers language-${languageExtension(hunk.fileName, data.patchInfo.repoName)}`}, hunk.beforeText))
)
])
]),
m('div', {class: "diff-right flex-grow-1"}, [
m('span', {class: 'font-monospace text-secondary'}, 'After'),
m('div', {class: "row"},
m('div', {class: "col-auto border-end"}, m('pre', {class: "mb-0"}, lineNumbers(hunk.beforeText).map((lineNumber) => {
return (lineNumber + hunk.lineNumber - 1).toString()
}))),
m('div', {class: "col overflow-scroll"},
m('pre', {class: "mb-0", 'data-start': hunk.lineNumber},
m('code', {'data-type': "after", class: `line-numbers language-${languageExtension(hunk.fileName, data.patchInfo.repoName)}`}, hunk.afterText)
)
)
)63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
m('div', {class: "flex-grow-1 diff-left pe-2"}, [
m('span', {class: 'font-monospace text-secondary'}, 'Before'),
m('div', {class: "row"}, [
m('div', {class: "col-auto border-end"},
m('pre', {class: "mb-0"}, lineNumbers(hunk.beforeText).map((lineNumber) => {
return (lineNumber + hunk.lineNumber - 1).toString()
}).join('\n'))
),
m('div', {class: "col overflow-scroll"},
m('pre', {class: "mb-0", 'data-start': hunk.lineNumber}, m('code', {'data-type': 'before', class: `line-numbers language-${languageExtension(hunk.fileName, data.patchInfo.repoName)}`}, m.trust(hunk.beforeText)))
)
])
]),
m('div', {class: "diff-right flex-grow-1"}, [
m('span', {class: 'font-monospace text-secondary'}, 'After'),
m('div', {class: "row"},
m('div', {class: "col-auto border-end"},
m('pre', {class: "mb-0"}, lineNumbers(hunk.beforeText).map((lineNumber) => {
return (lineNumber + hunk.lineNumber - 1).toString()
}).join('\n'))
),
m('div', {class: "col overflow-scroll"},
m('pre', {class: "mb-0", 'data-start': hunk.lineNumber},
m('code', {'data-type': "after", class: `line-numbers language-${languageExtension(hunk.fileName, data.patchInfo.repoName)}`}, m.trust(hunk.afterText))
)
)
)