From d5d0732bf3c4f86cefbea96df1a209863d825935 Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Sat, 30 Jun 2018 16:12:01 +0100 Subject: [PATCH] Clipper: Upgrade joplin-turndonw to fix import of literal HTML code --- CliClient/package.json | 2 +- CliClient/tests/html_to_md/text_with_escaped_html.html | 5 +++++ CliClient/tests/html_to_md/text_with_escaped_html.md | 9 +++++++++ ElectronClient/app/gui/NoteText.jsx | 2 +- ElectronClient/app/package.json | 2 +- 5 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 CliClient/tests/html_to_md/text_with_escaped_html.html create mode 100644 CliClient/tests/html_to_md/text_with_escaped_html.md diff --git a/CliClient/package.json b/CliClient/package.json index 5381e8baea..d1f9bb42f4 100644 --- a/CliClient/package.json +++ b/CliClient/package.json @@ -38,7 +38,7 @@ "html-entities": "^1.2.1", "html-minifier": "^3.5.15", "image-type": "^3.0.0", - "joplin-turndown": "^4.0.7", + "joplin-turndown": "^4.0.8", "joplin-turndown-plugin-gfm": "^1.0.7", "jssha": "^2.3.0", "levenshtein": "^1.0.5", diff --git a/CliClient/tests/html_to_md/text_with_escaped_html.html b/CliClient/tests/html_to_md/text_with_escaped_html.html new file mode 100644 index 0000000000..5cdabe7ed7 --- /dev/null +++ b/CliClient/tests/html_to_md/text_with_escaped_html.html @@ -0,0 +1,5 @@ +

Some text, not an image, so it should remain escaped:

+

<img src="http://test.com/image.png" />

+

<p class="testing">Paragraph example</p> +

But this is code so it can be unescaped:

+
<img src="http://test.com/image.png" />
\ No newline at end of file diff --git a/CliClient/tests/html_to_md/text_with_escaped_html.md b/CliClient/tests/html_to_md/text_with_escaped_html.md new file mode 100644 index 0000000000..89d3719bea --- /dev/null +++ b/CliClient/tests/html_to_md/text_with_escaped_html.md @@ -0,0 +1,9 @@ +Some text, not an image, so it should remain escaped: + +<img src="http://test.com/image.png" /> + +<p class="testing">Paragraph example</p> + +But this is code so it can be unescaped: + + \ No newline at end of file diff --git a/ElectronClient/app/gui/NoteText.jsx b/ElectronClient/app/gui/NoteText.jsx index 46f7d41162..4cc30ac9ff 100644 --- a/ElectronClient/app/gui/NoteText.jsx +++ b/ElectronClient/app/gui/NoteText.jsx @@ -720,7 +720,7 @@ class NoteTextComponent extends React.Component { this.resourceLoadedTimeoutId_ = null; this.updateHtml(); this.forceUpdate(); - }, 1000); + }, 100); }, postMessageSyntax: 'ipcRenderer.sendToHost', }; diff --git a/ElectronClient/app/package.json b/ElectronClient/app/package.json index 59324cbb2a..87aeb24234 100644 --- a/ElectronClient/app/package.json +++ b/ElectronClient/app/package.json @@ -91,7 +91,7 @@ "highlight.js": "^9.12.0", "html-entities": "^1.2.1", "image-type": "^3.0.0", - "joplin-turndown": "^4.0.7", + "joplin-turndown": "^4.0.8", "joplin-turndown-plugin-gfm": "^1.0.7", "jssha": "^2.3.1", "katex": "^0.9.0",