Skip to content

Commit

Permalink
Fix to notes
Browse files Browse the repository at this point in the history
  • Loading branch information
richmahn committed Sep 18, 2024
1 parent 209c3db commit 0feb9a2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/helpers/html.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export function encodeHTML(s) {

export function convertNoteFromMD2HTML(note, bookId, chapterStr) {
const md = new MarkdownIt();
const noteAsProperMarkdown = note.replaceAll('\\n', '\n').replaceAll('<br>', '\n').replaceAll('rc://*/', 'rc://en/') // change * to en do avoid becoming italic in Markdown
const noteAsProperMarkdown = note?.replaceAll('\\n', '\n').replaceAll('<br>', '\n').replaceAll('rc://*/', 'rc://en/') || ''; // change * to en do avoid becoming italic in Markdown
note = md.render(noteAsProperMarkdown);
note = note.replace(/href="\.\/0*([^/".]+)(\.md){0,1}"/g, `href="#nav-${bookId}-${chapterStr}-$1"`);
note = note.replace(/href="\.\.\/0*([^/".]+)\/0*([^/".]+)(\.md){0,1}"/g, `href="#nav-${bookId}-$1-$2"`);
Expand Down

0 comments on commit 0feb9a2

Please sign in to comment.