Skip to content

Commit

Permalink
fix: can not render if there is a node without href
Browse files Browse the repository at this point in the history
  • Loading branch information
heycalmdown committed Nov 28, 2018
1 parent 72df10c commit 5708794
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ export function link(section: Section): Section {
const $ = cheerio.load(section.body);
const aList = $('a');
if (aList.length === 0) return section;
aList.each((i, el) => {
aList.each((_i, el) => {
if (!el.attribs.href) return;
if (el.attribs.href[0] === '/') {
el.attribs.href = host + el.attribs.href;
}
Expand Down

0 comments on commit 5708794

Please sign in to comment.