-
Notifications
You must be signed in to change notification settings - Fork 35
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
Preformatted code HTML entity tag are changing real #42
Comments
@thegulshankumar thanks for reporting this. It took me a while to figure out why this might be an issue. The answers/comments here give a good explanation of why we don't want to use any HTML tags as is within a So, a few options, none of them likely to be perfect for your workflow. I'd suggest this: when you add a code snippet in a web application using markdown, there's usually an option to specify the code language, so that the syntax can be properly highlighted. I haven't looked, but would assume that a widely-used code snippet inserter for WordPress would also offer specifying what language of code is in the snippet. If it's HTML/XML, then we'd hope they would encode HTML entities for us, ie your
would become
OK, I just tseted the Code Syntax Block, which does work as expected. Using this to render your HTML code snippets will properly escape them, make them prettier and optionally show line numbers: So, I would suggest this is more an issue/limitation of WP's built-in options for displaying code. Their default Gutenberg block should have similar options to that plugin above, IMO. Perhaps they've already had a discussion on it and chosen not to or someone just needs to raise it to them (hint hint ;) |
Closing this here. Will still be searchable for anyone else, but not an issue needing to be fixed within the plugin(s) |
WordPress already uses HTML entity tags but after export it turns real. Please refer to line 192 to see difference |
cross-referencing our discussion of the issue being valid here: #47 |
should be fixed now, covered by tests |
Sharing any code snippet would be possible once this is fixed.
How to repro?
Write a new post with below code
<meta name="robots" content="noindex">
Export static site as ZIP, you will see like this in source code.
This can lead to noindex web page. Once I faced this issue.
The text was updated successfully, but these errors were encountered: