Skip to content

Commit

Permalink
fix markdown headings
Browse files Browse the repository at this point in the history
  • Loading branch information
merlinfuchs committed Mar 24, 2024
1 parent a7ac510 commit 1cd256b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion embedg-app/src/discord/markdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,10 @@ const bodyRules = {
}),
heading: Object.assign({}, markdown.defaultRules.heading, {
match: function (source, state) {
if (state.prevCapture === null || state.prevCapture[0] === "\n") {
if (
state.prevCapture === null ||
state.prevCapture[state.prevCapture.length - 1] === "\n"
) {
const re = /^(#{1,3}) +([^\n]+?)(\n|$)/;
return re.exec(source);
}
Expand Down

0 comments on commit 1cd256b

Please sign in to comment.