HTML Purifier Special Characters Question? - special-characters

How do I display this in © html purifier instead of this all the time ©. In other words how do I display both in html purifier http://htmlpurifier.org/?

©
If your using firefox select the above code, right click and click on view selection source.
or
You should write & amp ; #169; altogether.

The following worked for me:
© ©
Here is a screenshot from the HTMLPurify demo page, showing the result.
Purify http://img28.imageshack.us/img28/9791/purify.jpg

Related

Adding mustache template variables while editing in TinyMCE

I'd like to use the TinyMCE editor to write text that includes Mustache template variables, specifically to include repeating groups. I'm willing to use the html code view within TinyMCE if I have to (this is definitely a rarer use case).
I can do it just fine with an ordered list. That is, in the code view I can write
<p>Blah blah blah</p>
<ol>
{{#info.courses}}
<li>{{course}} -- {{course_title}}</li>
{{/info.courses}}
</ol>
<p>All done!</p>
and I get a nice ordered list of all the courses and titles.
However, if I try the same thing with a table (replace <ol> with <table>, etc) TinyMCE rearranges the code when I exit the HTML code view. It removes the repetition tags and places both in a paragraph before the table.
Any way to get TinyMCE to leave my changes to the HTML alone?
I realize it is asking a lot to change the representation of what TinyMCE is working on, but thought I'd ask.
Alternatively, any suggestions on other approaches to include Mustache tags in the contents of the editor?
I'm currently using version 4.9.4.

GitHub Markdown Links In List Do Not Display Correctly

Issue
I noticed on GitHub that links do not display correctly when they are inserted into a list as seen below.
I created a bug for this also on GitHub a week ago but have not heard back yet.
Working image using markdown
**Here is a link:**
[Link](https://github.com/)
Image in a list
**Here is a link in a list:**
<ol>
<li>Text [Link](https://github.com/) text</li>
<li>Text</li>
</ol>
Screenshot of the issue
Is there a reason for not using only markdown, because this works
**Here is a link in a list:**
1. Text [Link](https://github.com/) text
2. Text
I think you cannot mix markdown inside html

Plunker Readme.md does not show in embedded preview?

I have written some markdown text in the README.md of a plunk. If I open the Embedded View, and click View the project details button on the top right, the README.md text does not show, just the name of the Plunk and the creator are displayed.
Also, on the Info panel, the markdown does not display the code syntax highlighting - it puts it in a code block, but without the highlighting
```javascript
"use babel";
document.onload = (e) => {
alert('I just annoyed whoever visited this page! USING ES6!');
};
```
Anyone have any info or advice on this?
In order to create an embedded plunk that displays a rendered version of a Markdown (or other) file as the default view, two things need to be done:
show=preview - Tell the embed that the only pane to be shown should be the preview pane. You could also say show=script.js,preview to tell the embed to show the script.js file and the preview.
preview=README.md - Tell the embed that instead of opening the default / preview, to use a specific file. The filename specified does not need to be exact; preview=readme will also work.
For example, here is a link that demonstrates this for the plunk you provided: https://embed.plnkr.co/2mIgB8pGRO7pHXpKJWxj/?show=preview&preview=readme
These, and other supported configuration options, for the embed view are detailed in this gitbook page.

How to instance a codesample of tinymce version 4x?

I really like tinymce version 4x, but when i'm trying to use it, i have a problem, when i use codesample it work perfectly in tinymce editor, but i i want to show it in tag , it's my trouble.Please tell me if you have any ideas.
Thanks for helps.
UPDATE - TinyMCE 4.3.2 eliminates the <br> tags that this post shows how to remove so Step 3 should not be needed in 4.3.2 or later.
The key to resolving this is knowing that TinyMCE relies on Prism.js for the syntax highlighting capability.
If you want to extract the content from TinyMCE and have it appear elsewhere you need to...
Step 1: Include Prism.js and prism.css in your page - these can be downloaded from the Prism web site.
Step 2: Use TinyMCE's APIs to extract the content from the editor. For example:
var htmlToLoad = tinyMCE.get('area3').getContent();
Step 3: Replace any <br /> elements in the content with a simple newline:
var htmlToLoad = tinyMCE.get('area3').getContent();
htmlToLoad = htmlToLoad.replace(/<br \/>/g,'\n');
You need to do this because Prism's highlight function (see Step 5) will remove the <br /> tags causing the spacing to not look as things do in TinyMCE.
Step 4: Place the content into an HTML block element:
document.getElementById("result").innerHTML = htmlToLoad;
Step 5: Run Prism's highlight function
Prism.highlightAll();
This triggers Prism to re-evaluate the DOM for things that it should highlight - it won't do this automatically.

RichText in Magnolia CMS is changing HTML text

I would like to ask how I can block richText from changing html text under source view.
I'm using Blossom module and defined richText as #Chris J advised me to do:
Add source button to Magnolia CMS richText control
Whenever I put html code in source code, switch to normal view and get back to source view the code is changed. For example the following part of code is missing :
<div class="components"> <div class="product col img-slider"> <div id="product-image" class="royalSlider productImage rsDefault"> <div class="rsContent"> <div class="rsTmb"><img src="/magnoliaPublic/resources/XXX/products/product_7.jpg" alt="">
and is replaced with folowing
<p><img alt="" src="/magnoliaPublic/resources/XXX/products/product_7.jpg" /></p>
I need to provide the possibility for the user to put html code and next to see in on the web page.
Regards
Jan
Jan. I'd ask why you are using a rich text area if you are entering HTML. It is not really designed for this usage. Would you be better off with an ordinary text field? In the STK (you mentioned this in your previous question) you will find a component that serves exactly this purpose.
Under "Configuration" you will find it at /modules/standard-templating-kit/templates/components/content/stkHTML
You will see that the template script is simply:
[#if content.editHTML?has_content]
${cmsfn.decode(content).editHTML}
[/#if]
If you want to stick with a purely Blossom approach, you may need to recreate this but it is an incredibly simple component.
Incidentally, in Magnolia 5.4 there is a code editing field used in a similar component that offers syntax highlighting. You can see this by logging into the demo site and trying to add an HTML component to the main area of the page travel/contact.