Skip to content

Commit

Permalink
Small fixes (#64)
Browse files Browse the repository at this point in the history
- Compile before linting since the web-ext lint step runs on the compiled outputs
- Run prettier on src files
  • Loading branch information
kfarnung authored Oct 6, 2024
1 parent 90c5f5a commit 99c8808
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"build": "npm run compile && web-ext build -n aoc-to-markdown-addon.zip -s addon --overwrite-dest",
"compile": "npm run genmanifest && webpack",
"genmanifest": "node ./tools/genmanifest.js ./src/manifest.json ./addon/manifest.json",
"lint": "eslint . && web-ext lint -s addon",
"lint": "eslint . && npm run compile && web-ext lint -s addon",
"lint-fix": "eslint . --fix",
"prepare": "npm run compile",
"prestart": "npm run compile",
Expand Down
7 changes: 3 additions & 4 deletions src/content_scripts/to-markdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function generateMarkdown(doc) {
// ```html
// <code>1 + 1 = <em>2</em></code>
// ```
//
//
// The default rendering results in the underscores being rendered, as there
// isn't a proper way to render emphasis within code blocks without resorting
// to HTML again. In this case the best solution is to drop the emphasis
Expand All @@ -57,8 +57,7 @@ function generateMarkdown(doc) {
// where the previous code did not make a modification.
turndownService.addRule("emphasisWithinCode", {
filter: (node) =>
node.nodeName == "EM" &&
node.parentNode.nodeName == "CODE",
node.nodeName == "EM" && node.parentNode.nodeName == "CODE",
replacement: (content) => content,
});

Expand All @@ -75,7 +74,7 @@ function expandHrefs(article) {
if (link.href) {
// Reading the `href` seems to expand it, setting it back will make it
// permanent.
link.href = link.href
link.href = link.href;
}
}
}
Expand Down

0 comments on commit 99c8808

Please sign in to comment.