Skip to content

Commit

Permalink
fix duplicate text when hero is active
Browse files Browse the repository at this point in the history
  • Loading branch information
wibjorn committed Nov 27, 2023
1 parent 80ef567 commit e9a6122
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion plugins/parcel-transformer-markdown-html/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,8 @@ function extractH1AndFirstP(htmlString) {
);
const h1 = h1Match ? h1Match[1].toString() : null;
// for morning, why isn't string replace working
const html = htmlString.replaceAll(entireh1Match, '').replace(pMatch, '');
const html = htmlString
.replaceAll(entireh1Match, '')
.replace(p, '<div class="h1-inverse-spacer"></div>');
return { h1, p, html };
}
4 changes: 4 additions & 0 deletions site/src/scaffold/styles/layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ html {
justify-content: flex-end;
}

.h1-inverse-spacer {
margin-block-end: -2rem;
}

#article {
grid-area: article;
overflow: hidden;
Expand Down

0 comments on commit e9a6122

Please sign in to comment.