inline script in the editor has problems with ==
See original GitHub issuePut this in the editor (Ghost v0.6.4)
<script>
var x = 0;
if ( x === 0 ) {
alert("yay");
}
</script>
then publish.
View the blog post in a web browser. Would expect an alert box saying ‘yay’. However, we get a javascript error.
Inspecting the rendered HTML/JS code and we see
<script>
var x = 0;
if ( x <mark>= 0 ) {
alert("yay");
}
</script>
It looks like some macro replacement magic is taking place, replacing any ==
characters with <mark>
.
Issue Analytics
- State:
- Created 8 years ago
- Reactions:2
- Comments:17 (5 by maintainers)
Top Results From Across the Web
inline task script editor has problems with spaces - Jira Atlassian
notice strange A character and notice that cursor is moved by two characters to the left, this is also wrong, cursor is at...
Read more >PH07336: INLINE SCRIPT EDITOR IS NOT LOADING ... - IBM
Steps to reproduce â ‹ 1) Go to Manage Artifact Templates 2) Copy the template the "Default manual test script template" 3) In...
Read more >[Bug] HTML language does not recognize inline ... - GitHub
Inline code is recognized as JavaScript, is syntax highlighted, and editing/navigation does not raise exceptions.
Read more >Logic App (Standard) inline script window is too small
We have issues using the script editor for actions like "Execute ... 1 of blog post titled Logic App (Standard) inline script window...
Read more >javascript - Why Should I Avoid Inline Scripting?
Performance-wise, you don't always have better performances when putting JavaScript in a separate file. Usually, we are tempted to consider that ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I have the same issue on Ghost Pro, the only way to avoid the problem is to add
<pre>
tags before and after the<script>
tags.@intositeme The work around I’m using is to modify showdown-ghost v0.3.6 to escape
<script>
blocks before applying highlighting. Assuming you are using Ghost v0.7.6 simply replacenode_modules\showdown-ghost\src\extensions\highlight.js
with the following and restart Ghost: