Skip to content

Commit f5cd5ba

Browse files
committed
Convert headings in lists to bold
1 parent c5d1b6c commit f5cd5ba

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

src/commands/external/ArticleCommand.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,17 @@ export default class ArticleCommand extends Command {
181181
if (!content) {
182182
return '';
183183
}
184+
185+
// Check if the heading is inside a list
186+
let parent = node.parentNode;
187+
while (parent) {
188+
if (parent.nodeName === 'UL' || parent.nodeName === 'OL') {
189+
node.localName = "b";
190+
break;
191+
}
192+
parent = parent.parentNode;
193+
}
194+
184195
switch (node.localName) {
185196
case 'h1':
186197
return '# ' + content + '\n';
@@ -204,7 +215,7 @@ export default class ArticleCommand extends Command {
204215
})
205216
//remove unsupported tags
206217
.addRule('remove', {
207-
filter: ['img', 'script'],
218+
filter: ['img', 'script', 'youtube-video'],
208219
replacement() {
209220
return '';
210221
}

0 commit comments

Comments
 (0)