Skip to content
This repository has been archived by the owner on Jan 16, 2023. It is now read-only.

Commit

Permalink
fix img
Browse files Browse the repository at this point in the history
  • Loading branch information
theowenyoung committed Dec 2, 2022
1 parent 4fa6bb4 commit 18f7d9e
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## 0.0.40

- Support Notion
- Fix p tag with img

## 0.0.39

Expand Down
7 changes: 7 additions & 0 deletions docs/hard.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,10 @@
## 5. detail page, title merge

1. https://libreddit.de/


## 6. p img

1. <https://www.atlantamagazine.com/dining-news/what-its-like-to-be-a-food-writer-when-you-can-taste-everything-you-see/>

p标签,里有图片,并且有文字。
2 changes: 1 addition & 1 deletion src/chrome_manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"default_locale": "en",
"name": "Immersive Translate",
"description": "Let's experience immersive web translation, with bilingual simultaneous display and translation of only the important content.",
"version": "0.0.39",
"version": "0.0.40",
"homepage_url": "https://github.com/immersive-translate/immersive-translate",

"commands": {
Expand Down
8 changes: 7 additions & 1 deletion src/contentScript/enhance.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,13 @@ function isValidNode(node){
let isIncludeImg = node.querySelector('img');
if(isIncludeImg && node.childNodes.length<3){
// treat it as img node
return false;
// check length
const innerText = node.innerText;
if(innerText.length<80){
return false;
}else{
return true;
}
}


Expand Down
2 changes: 1 addition & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"default_locale": "en",
"name": "Immersive Translate",
"description": "Let's experience immersive web translation, with bilingual simultaneous display and translation of only the important content.",
"version": "0.0.39",
"version": "0.0.40",
"homepage_url": "https://github.com/immersive-translate/immersive-translate",

"browser_specific_settings": {
Expand Down

0 comments on commit 18f7d9e

Please sign in to comment.