Skip to content

Commit

Permalink
fix: πŸ› Wrap shortcodes in <div> so they don't get <p> wrapped
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Reese committed Nov 10, 2020
1 parent 2e7a776 commit 2944b34
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/markdown/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ const plugin = {
let match;
while ((match = MDImgRegex.exec(md)) !== null) {
const [fullMatch, alt, src] = match;
md = md.replace(fullMatch, `${openPattern}picture alt="${alt}" src="${src}" /${closePattern}`);
md = md.replace(
fullMatch,
`<div class="md-img">${openPattern}picture alt="${alt}" src="${src}" /${closePattern}</div>`,
);
}
}

Expand Down

0 comments on commit 2944b34

Please sign in to comment.