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

How to handle text-align in restricted mode #180

Closed
ikirudennis opened this issue Aug 30, 2017 · 1 comment
Closed

How to handle text-align in restricted mode #180

ikirudennis opened this issue Aug 30, 2017 · 1 comment

Comments

@ikirudennis
Copy link
Member

ikirudennis commented Aug 30, 2017

Hi, guys. I had a user file an issue regarding the handling of the text-alignment shortcuts in restricted mode. For example, running the examples on https://txstyle.org/doc/24/text-alignment through python-textile, the output is essentially the same as just running the raw text through a html-entity encoder: the angle brackets are turned into their < and > counterparts, and the paragraph p tags are not handled. I created a quick test for php-textile, and it results in a fatal error:

Stack trace:
#0 /.../php-textile/src/Netcarver/Textile/Parser.php(1994): Netcarver\Textile\Parser->parseAttribsToArray('<', '', true, '')
#1 /.../php-textile/src/Netcarver/Textile/Parser.php(2842): Netcarver\Textile\Parser->parseAttribs('<')
#2 /.../php-textile/src/Netcarver/Textile/Parser.php(2776): Netcarver\Textile\Parser->fBlock(Array)
#3 /.../php-textile/src/Netcarver/Textile/Parser.php(1590): Netcarver\Textile\Parser->blocks('p<. Left ali...')
#4 /.../php-textile/src/test.php(9): Netcarver\Textile\Parser->parse('p<. Left ali...')
#5 {main}
  thrown in /.../php-textile/src/Netcarver/Textile/Parser.php on line 2115

So this raises the question of: How should text-alignment be handled in restricted mode?

@netcarver
Copy link
Contributor

@ikirudennis Hello Dennis, good question and good find.

As restricted mode was really meant for application to comments left of sites, I don't really think the commentators should be able to leave layout hints like this. My vote is for stripping the paragraph alignment out in restricted mode.

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

No branches or pull requests

2 participants