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

Fix for wrong escaping in bc #12

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Fix for wrong escaping in bc #12

wants to merge 3 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Jul 10, 2014

Hello,
I have made a fix and test for problems with bc (see issue #3)

Please check and add this fix.

@ghost ghost changed the title Fix for wrong escaping in bc (issue #3) Fix for wrong escaping in bc Jul 10, 2014
@ghost
Copy link
Author

ghost commented Jul 12, 2014

Sorry the fix does not work in mixed content with other bc. and bc...
Please ignore commit https://github.com/GwenDragon/text-textile/commit/1eea975ee1232b9e9e2bddb7ebc83e2f7caa5e67

@ghost
Copy link
Author

ghost commented Jul 12, 2014

In my fix the force of HTML entity encoding is done in code for bc now.

commit https://github.com/GwenDragon/text-textile/commit/a30437f923aea5919bcdef06bce5955f7175a671 works now correctly. I hope. ;)

@bradchoate
Copy link
Owner

I'll take a closer look; thanks for your patience and persistence. However, this is a breaking change that could affect existing uses of Textile out there. I need to take that into consideration.

@ghost
Copy link
Author

ghost commented Jul 28, 2014

@bradchoate Thanks for reply.

However, this is a breaking change that could affect existing uses of Textile out there.

How does my patch violate Textiles behaviour?

As i understood the docs for textiles bc, I thought all text in <code> or <blockcode> should be HTML escaped. Thats means all content for blockcode is HTML escaped to create text-source code, not executable JS or raw HTML elements.

bc
A “bc” signature is short for “block code”, which implies a preformatted section like the 'pre' block, but it also gets a <code> tag (or for XHTML 2, a <blockcode> tag is used instead).

Note that within a “bc” block, < and > are translated into HTML entities automatically.

MoveableType.org: Textile 2 Syntax

bc

A "bc" signature is short for "block code", which implies a preformatted section like the "pre" block, but it also gets a <code> tag (or for XHTML 2, a <blockcode> tag is used instead).

Note that within a "bc" block, < and > are translated into HTML entities automatically.

CPAN Text::Textile

Note that within a "bc" block, < and > are translated into HTML entities automatically.

That means: < translated to &lt;

There is no hint in docs, that bc does skip some HTML elements or XML prolog.
Otherwise the documentation is not clear.

HTML docs states for code element:

The <code> element represents a fragment of computer code.

I think it means the raw text, not interpreted as JS or HTML.

Do i misinterpet this so much? Please explain.

If i'm not right, pease add the ability to have a setting running bc in "escaping HTML mode".

PS: I'm a Perl programming webdev and webmistress, HTML is familiar for me. ;)

I need to take that into consideration.

Thanks. And for maintaining the Perl package, not letting it getting orphan.

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.

2 participants