Skip to content

Commit

Permalink
feat(djot): min comment
Browse files Browse the repository at this point in the history
  • Loading branch information
teomrd committed Nov 22, 2024
1 parent 562fc7f commit 81f73a5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/js/components/organisms/markdown/markDownViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ const markDownViewer = (() => {

this.autoLink();

// add a copy button to the code blocks
const { elements } = select("pre");
Array.prototype.slice.call(elements).forEach((el) => {
const copyBtn = button("📋 Copy", async (e) => {
Expand Down
10 changes: 6 additions & 4 deletions src/js/components/organisms/markdown/mdToHtml.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { parse, renderHTML } from "@djot/djot";

export const convertMarkDownToHtml = (md: string) => {
return renderHTML(parse(md, {
sourcePositions: true,
warn: (warning) => console.log(warning.render()),
}));
return renderHTML(
parse(md, {
sourcePositions: true,
warn: (warning) => console.log(warning.render()),
}),
);
};

0 comments on commit 81f73a5

Please sign in to comment.