Preview hyperlink not rendering the same as final page #3731
Replies: 2 comments
-
Hi, I updated my issue report because the relevant code wasn't wrapped in code block delimiters. But I believe the parser is seeing the hyperlink portion of the window.open and rerendering it; changing the intention of the code. What is odd is that in the live preview window, the javascript function works as intended, but once the page is published - doing a view source, the link has been rewritten. I'm not sure how the parsing works, but something is being run through a different branch of code it seems. |
Beta Was this translation helpful? Give feedback.
-
Can you try this code which works on my wiki.js |
Beta Was this translation helpful? Give feedback.
-
Describe the bug
Markdown is supposed to fallback to actual HTML. I attempted to create a hyperlink in this form to open a new tab/window:
<a href="javascript:window.open(url, '_blank');">Popup</a>
While in the editor, this works fine. I can write the markup, move to the Preview pane, click the newly formed link, and the status preview and actual functionality work perfectly.
However, once I save the page, the link gets rewritten so it's just a basic
<a href="url">Popup</a>
I tested caching by modifying other elements of the page, and the page is definitely getting updated, but the preview and live results are not similar.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I expect the behavior of the preview pane to mirror what happens when you save the actual page.
Host Info (please complete the following information):
Beta Was this translation helpful? Give feedback.
All reactions