Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use onPageContentRaw instead of onPageContentProcessed hook #22

Closed
wants to merge 1 commit into from

Conversation

manuszep
Copy link

@manuszep manuszep commented Sep 30, 2016

Use onPageContentRaw instead of onPageContentProcessed hook to avoid getting the shortcode output wrapped in a paragraph tag.

In the current version, when you use the [center]text[/center] block shortcode, the output is

<p><div style="text-align: center;">text</div></p>

To avoid that extra p tag, I used the onPageContentRaw hook which will inject markup before markdown is processed.

…getting the shortcode output wrapped in a paragraph tag.
@manuszep
Copy link
Author

It's worth mentionning that the markdown extra option should be activated and the markdown="1" attribute needs to be added on the wrapper element. ex:

<div style="text-align: center;" markdown="1">text</div>

Otherwise, the markdown inside the HTML tags is not processed.

@rhukster
Copy link
Member

This actually breaks LOTs of stuff. markdown is no longer processed when encapsulated in HTML, so have it firing first effectively means you will no longer be able to use markdown inside shortcode. That's simply not an acceptable compromise.

@rhukster rhukster closed this Feb 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants