Object coding - no perfect solution?

We use the ckeditor plugin for redmine ( https://github.com/a-ono/redmine_ckeditor ) and experience the following problem:

As a-ono, the plugin developer, adds: "There seems to be no perfect solution."

I found http://komlenic.com/246/encoding-entities-to-work-with-ckeditor-3/ , http://ckeditor.com/forums/Support/inside-tries-create-paragraph#comment-54348 and some additional information about "forceSimpleAmpersand: true" as well as config.entities_latin = false ;, but I'm not too sure how to proceed. We are in the process of moving additional users to Redmine, but this is a pretty show stopper if they cannot post links or xml / html content (for example, as part of an error report).

So this goes for all CKEditor Pros. Any clues?

+4
source share
2 answers

, , Redmine . CKEditor - , . , , . , CKEditor, , ( Redmine , , Redmine).

. <xml>. HTML :

<p>This is a tag: <code>&lt;xml&gt;</code>.</p>

editor.getData() , , <textarea>.

, (, demo):

editor.setData( '<p>This is a tag: <code>&lt;xml&gt;</code>.</p>' );

. :

Loading data using editor.setData ()

CKEditor <textarea> , , , . , , :

<textarea><p>This is a tag: <code>&lt;xml&gt;</code>.</p></textarea>

JavaScript textarea.value, :

<p>This is a tag: <code><xml></code>.</p>

, <xml> , HTML &lt; <.

, ​​ :

<textarea>&lt;p&gt;This is a tag: &lt;code&gt;&amp;lt;xml&amp;gt;&lt;/code&gt;.&lt;/p&gt;</textarea>

, < &lt;, &lt; &amp;lt;. , HTML. , CKEditor. , CKEditor - . - , , , .

+2

, python " → > " python . HTML & gt; > wiki. " → > ", <pre> .

, /redmine _ckeditor/lib/redmine_ckeditor/wiki_formatting/formatter.rb 17:

    %Q[<pre>\n<code class="#{lang} syntaxhl">#{
      Redmine::SyntaxHighlighting.highlight_by_language(code, lang)
    }</code>\n</pre>]

    %Q[<pre>\n<code class="#{lang} syntaxhl">#{
      Redmine::SyntaxHighlighting.highlight_by_language(CGI.unescapeHTML(code), lang)
    }</code>\n</pre>]

HTML .

0

Source: https://habr.com/ru/post/1584163/


All Articles