Skip to content

Commit

Permalink
fix(plugins/notes): preserve line mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
moki committed May 22, 2023
1 parent 8d7b28f commit 29e4c5c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/transform/plugins/notes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,10 @@ const notes: MarkdownItPluginCb = (md, {lang, path: optPath, log}) => {
const newOpenToken = new state.Token('yfm_note_open', 'div', 1);
newOpenToken.attrSet('class', `yfm-note yfm-accent-${type}`);
newOpenToken.attrSet('note-type', type);
newOpenToken.map = tokens[i].map;

const newCloseToken = new state.Token('yfm_note_close', 'div', -1);
newCloseToken.map = tokens[closeTokenIdx].map;

// Add extra paragraph
const titleOpen = new state.Token('yfm_note_title_open', 'p', 1);
Expand Down

0 comments on commit 29e4c5c

Please sign in to comment.