Skip to content
New issue

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

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

Already on GitHub? # to your account

Newline in list followed by strong text produces strange output #172

Closed
ikirudennis opened this issue Nov 23, 2016 · 2 comments
Closed

Newline in list followed by strong text produces strange output #172

ikirudennis opened this issue Nov 23, 2016 · 2 comments
Labels

Comments

@ikirudennis
Copy link
Member

I had a user of python-textile report an issue which I found produces strange output in php-textile. The input:

# xxx
# yyy
*blah*

Expected output:

<ol>
	<li>xxx</li>
	<li>yyy<br />
<strong>blah</strong></li>
</ol>

Result:

<p><ol>
	<li>xxx</li>
	<li>yyy</li><br />
</ol><br />
<strong>blah</strong></p>

I'm not sure, but I think the result is not valid html, aside from being incorrect. It looks like it's localized to only strong and emphasis textile markup because they start with asterisk which is also used for lists. I haven't had a chance to dive into this myself, but if I find a solution, I'll pass it along.

@netcarver
Copy link
Contributor

@ikirudennis Thanks for the issue report - I must have posted on python-textile about the same time you posted here. Possibly similar to #22.

@ikirudennis
Copy link
Member Author

Having looked through that issue thread, it seems to be slightly different from this one.

If *blah* is changed to %blah% instead, it works just fine. Both <strong> and <span> can contain the same types on content and can have the same types of parent elements, so shouldn't *blah* and %blah% be handled the same? It's only the fact that the textile syntax for strong, emphasis and unordered lists all utilize an asterisk that introduces this sort of logical conundrum.

Textile is consistent about separating content when two newlines are entered, and if that's what's desired, then that should be in the input. However, in this edge-case it would seem that the logical that the single newline is deliberate and would imply the expected output above.

I'm going to first try to produce that result in python-textile, and then see about porting the solution over to php-textile. Sound good?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants