Skip to content

Commit

Permalink
Fix a bug for auto-highlighting
Browse files Browse the repository at this point in the history
Auto-highlighting was done on all pages, regardless of whether we had
detected raw text or not. It would break many pages. Fix the bug.

Fixes: 99821c9 ("Switch to web extension framework")
  • Loading branch information
Qeole committed Nov 3, 2017
1 parent 99821c9 commit 4d32daa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

"manifest_version": 2,
"name": "Enlight",
"version": "2.0.9.12",
"version": "2.1.9.12",
"homepage_url": "https://github.com/Qeole/Enlight",
"description": "__MSG_description__",
"default_locale": "en",
Expand Down
5 changes: 3 additions & 2 deletions scripts/enlight-background.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,9 @@ function checkBodyListener(p) {
case "checkBodyPort":
p.onMessage.addListener((m) => {
console.debug("[enlight] Do we detect a code block?", m.isCodeBlock);
doHighlight("auto");
isHighlighted = true;
if (m.isCodeBlock)
doHighlight("auto");
isHighlighted = m.isCodeBlock;
});
break;
case "detectedLanguage":
Expand Down

0 comments on commit 4d32daa

Please sign in to comment.