[
https://issues.apache.org/jira/browse/JSPWIKI-1130?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18134066#comment-18134066
]
Arturo Bernal commented on JSPWIKI-1130:
----------------------------------------
Correction to my previous comment: there is a pull request now, 560
(https://github.com/apache/jspwiki/pull/560). It passes evalScripts false in
the preview request of Wiki.Edit.js. Checked in the browser with the war built
from that branch, on the same page as before: the editor stays, the text area
keeps the page text and the preview is rendered without running the script.
There is no automated test, the scripts have none in this repository. Leaving
the issue open until the pull request is reviewed.
> Preview doesn't handle embedded JavaScript correctly
> ----------------------------------------------------
>
> Key: JSPWIKI-1130
> URL: https://issues.apache.org/jira/browse/JSPWIKI-1130
> Project: JSPWiki
> Issue Type: Bug
> Components: Editors
> Affects Versions: 2.11.0-M6
> Reporter: Ulf Dittmer
> Priority: Minor
> Labels: pull-request-available
>
> If "jspwiki.translatorReader.allowHTML = true", JavaScript can be inserted
> into a page and executed like this:
> [{If page='SandBox' exists='true'
> <script language="javascript">document.writeln("<b>User Agent: </b>" +
> navigator.userAgent);</script>}]
> However, if preview is turned on during editing, executing the JavaScript
> interferes with the editor, replacing the editor page with the output of the
> code execution. I'm not sure whether it's possible to fix this while still
> trying to execute JavaScript. If not, disabling JavaScript during preview
> seems fine.
> [https://jspwiki-wiki.apache.org/Wiki.jsp?page=TESTEST] also shows this.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)