Skip to content

Commit

Permalink
feat: set grammar using its buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Oct 8, 2020
1 parent 043c406 commit 411748a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ async function highlightCodeFragments(domFragment: HTMLElement, grammar: string)

editor.setText(codeBlock.textContent?.replace(/\r?\n$/, '') ?? '');

atom.grammars.assignLanguageMode(editor, scopeForFenceName(fenceName));
atom.grammars.assignLanguageMode(editor.getBuffer(), scopeForFenceName(fenceName));
editor.setVisible(true);
return await tokenizeEditor(editorElement, preElement);
});
Expand Down

0 comments on commit 411748a

Please sign in to comment.