Skip to content
This repository has been archived by the owner on Apr 16, 2021. It is now read-only.

Updates the code shortcode to work with xml/html #20

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kylegundersen
Copy link

@kylegundersen kylegundersen commented Apr 6, 2017

Hey buddy I was unable to use xml/html in shortcode it would break the page and render the HTML instead of showing the code. I basically check to see if its lang = XML and then I filter the HTML entities and replace the auto added WordPress tags. We can discuss or modify the functionality.

@owent
Copy link
Owner

owent commented May 9, 2017

@kylegundersen I think you should use &lt;p&gt; instead of <p> if you want show html or xml inner a HTML DOM.
Other labels are all the same.

You can visit the bottom of https://highlightjs.org/static/demo/ to see the source of <pre><code class="xml"> for example.

@owent owent self-requested a review May 9, 2017 02:41
@owent owent self-assigned this May 9, 2017
@owent owent added the question label May 9, 2017
@kylegundersen
Copy link
Author

kylegundersen commented May 10, 2017

That doesn't prevent the auto paragraph and break tags that get generated in the_content natively by WordPress (tinyMce). Also I made it so developers could just copy and paste their code in without having to escape the html/xml content manually.

@owent
Copy link
Owner

owent commented May 10, 2017

@kylegundersen I try to press enter in my wordpress blog. But all <br /> are converted to \n after I publish my post. And if I write <p> label in souce, It also be fixed to the right content. but how can tinyMce generate a <p> label?

@kylegundersen
Copy link
Author

@owent
Copy link
Owner

owent commented May 31, 2017

@kylegundersen These tags should only be added after </pre> . I don't think it's a problem. Could you show me a sample please?

@kylegundersen
Copy link
Author

You are right it won't add them if the content's characters are escaped, but my addition makes it so you don't have to escape the html/xml. Which is just easier in my opinion.

@owent
Copy link
Owner

owent commented Oct 15, 2017

I think it's better to provide a option instead of just replacing these two tags.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants