Skip to content

Commit

Permalink
fix: Inline code in comments should look fine now
Browse files Browse the repository at this point in the history
  • Loading branch information
yammesicka committed Mar 26, 2024
1 parent f87079a commit fd58ad1
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lms/static/comments.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,17 @@ function configureMarkdownParser() {
code: (code, infoString, _) => {
const language = infoString || 'plaintext';
return `<pre><code class="language-${language}">${code}</code></pre>`;
},
codespan: (code) => {
const parsed = (
code
.replace(/&quot;/g, '"')
.replace(/&#39;/g, "'")
.replace(/&lt;/g, '<')
.replace(/&gt;/g, '>')
.replace(/&amp;/g, '&')
);
return `<code>${parsed}</code>`;
}
},
});
Expand Down

0 comments on commit fd58ad1

Please sign in to comment.