Comments (7)
I've updated the script. Please, test if it fixes the issue.
from scripts.
Something like #76?
from scripts.
I'll look into this.
from scripts.
The issue with the stray tag has been fixed.
However, it has now caused very odd behaviour. It seems that all single quotation marks and forward slashes in code blocks are replaced by ASCII code in the selected preview tag colour (e.g. the default purple) preceded by an & sign. Here is an example.
What it now looks like in preview:
from scripts.
Weird. I can't reproduce your case. I've typed in your text but it renders correctly.
The issue was that I've used post-render hook to put in tag highlighting into hmtl, but it messed with other html tags made by rendering. That caused the issue. For the fix I switched to pre-render hook, so the script puts html tags into markdown text. This hook wasn't available when I've first implemented the highlighting. The pre-render hook should not affect markdown rendering in any way. So that's weird.
Could you post your script setting, a line of markdown that is affected by this and the html the app makes of it (you can right click on the preview pane and export it).
For now it looks like I'd better drop tags highlighting. Maybe make it off by default and put some warnings to the description. Looks like there's no easy way to make it safe. Only parsing whole html DOM will root out all corner cases.
from scripts.
Requested information below.
Script settings:
Markdown
```sql
SELECT test from test where path = `/test/path`
```
HTML
<html><head><style>h1 { margin: 5px 0 20px 0; }h2, h3 { margin: 10px 0 15px 0; }table {border-spacing: 0; border-style: solid; border-width: 1px; border-collapse: collapse; margin-top: 0.5em;}th, td {padding: 2px 5px;}a { color: #FF9137; text-decoration: none; } pre, code { font-family: "Fira Code"; font-weight: normal; }pre { display: block; background-color: #f1f1f1; white-space: pre-wrap } code { padding: 3px; overflow: auto; line-height: 1.45em; background-color: #f1f1f1; border-radius: 5px; color: #000000; } .code-comment { color: #75715E; font-style: italic;} .code-string { color: #E6DB74;} .code-literal { color: #AE81FF;} .code-type { color: #66D9EF;} .code-builtin { color: #A6E22E;} .code-keyword { color: #F92672;} .code-other { color: #F92672;} code {background-color: transparent;}body {font-family: Tahoma; font-weight: normal; font-size: 10pt; color: #000000; background-color: #ffffff}h1 {font-family: Tahoma; font-weight: normal; font-weight: bold; font-size: 20pt; color: #00316e; background-color: #f1f1f4}h2 {font-family: Tahoma; font-weight: normal; font-weight: bold; font-size: 16pt; color: #003a82; background-color: #f1f1f4}h3 {font-family: Tahoma; font-weight: normal; font-weight: bold; font-size: 13pt; color: #004396; background-color: #f1f1f4}h4 {font-family: Tahoma; font-weight: normal; font-weight: bold; font-size: 10pt; color: #0051b4; background-color: #f1f1f4}h5 {font-family: Tahoma; font-weight: normal; font-weight: bold; font-size: 9pt; color: #0055be; background-color: #f1f1f4}h6 {font-family: Tahoma; font-weight: normal; font-weight: bold; font-size: 9pt; color: #0055be; background-color: #f1f1f4}a {font-family: Tahoma; font-weight: normal; font-size: 10pt; color: #fc7e00; background-color: #fff8ef}b, strong {font-family: Tahoma; font-weight: normal; font-weight: bold; font-size: 10pt; color: #00428a;}i, em {font-family: Tahoma; font-weight: normal; font-style: italic; font-size: 10pt; color: #0057ae;}code, pre > code, pre {font-family: "Fira Code"; font-weight: normal; font-size: 10pt; color: #006c00; background-color: #edfced}p > code, li > code {font-family: "Fira Code"; font-weight: normal; font-size: 10pt; color: #006c00; background-color: #edfced}.code-keyword {font-family: "Fira Code"; font-weight: normal; font-size: 10pt; color: #f92672; background-color: #edfced}.code-string {font-family: "Fira Code"; font-weight: normal; font-size: 10pt; color: #3ba23f; background-color: #edfced}.code-comment {font-family: "Fira Code"; font-weight: normal; font-size: 10pt; color: #908b74; background-color: #edfced}.code-type {font-family: "Fira Code"; font-weight: normal; font-size: 10pt; color: #636def; background-color: #edfced}.code-other {font-family: "Fira Code"; font-weight: normal; font-size: 10pt; color: #b57c50; background-color: #edfced}.code-literal {font-family: "Fira Code"; font-weight: normal; font-size: 10pt; color: #ae81ff; background-color: #edfced}.code-builtin {font-family: "Fira Code"; font-weight: normal; font-size: 10pt; color: #f92672; background-color: #edfced}mark {background-color:#FFFF00;}</style></head><body class="preview"><pre><code class="language-sql">SELECT test from test where path = &<b><font color="purple">96</font></b>;&<b><font color="purple">47</font></b>;test&<b><font color="purple">47</font></b>;path&<b><font color="purple">96</font></b>;</code></pre>
</body></html>
from scripts.
I have not found a fix for this. As of now the script should not mess with html, only prerendered markdown. So it's some kind of clash between what the script does and what renderer does. Even worse, the html injection I've used for highlighting messes tags in the code blocks. And that cannot be fixed at all.
I've removed tag highlighting feature from the script. The new version is in the repo.
from scripts.
Related Issues (20)
- [SUPPORT] Stuck trying to get Backlinks script to work HOT 4
- [SUPPORT] Mermaid diagrams script: theme configuration for sequenceDiagram HOT 6
- [BUG] Latex Math v0.0.6 script doesn't update pictures when color style is changed HOT 7
- [BUG] Toggle checkbox - checkbox where added in wrong place when autocreated from list HOT 5
- [FEATURE] Add video display support HOT 3
- [BUG] The "YAML nested tags" script breaks formatting and causing text lost in preview HOT 4
- [BUG] "exportFolder is not defined" in export-notes-as-website HOT 7
- [BUG] A Wiki Link to a note under notes sub-folder gives pop up "Note was not found" even if it exists HOT 4
- [SUPPORT] HOT 11
- [SUPPORT] HOT 2
- [SUPPORT] LateX Math results in very aliased images HOT 8
- adding favorite note script results with error " Expected a qualified name id"[BUG] HOT 10
- [SUPPORT] HOT 7
- [BUG] can't follow [[wiki linked]] file links that have spaces HOT 2
- [BUG] Scripts "export note as website" not working properly on Windows HOT 7
- [BUG] export note using pandoc not working on windows HOT 2
- [BUG] Backlinks doesn't support setext headers for title HOT 6
- [BUG] LaTeX math script generates empty icons instead of images HOT 3
- [BUG] Backlinks on Windows HOT 8
- [BUG] meeting-note filename when headline prefix is empty HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scripts.