Ticket #18 (closed enhancement: fixed)
Auto Paragraph HTML Parser
| Reported by: | mitsuhiko | Owned by: | |
|---|---|---|---|
| Priority: | minor | Milestone: | Zine 0.1 |
| Component: | usability | Version: | |
| Keywords: | Cc: |
Description (last modified by mitsuhiko) (diff)
Right now we just have the SimpleHTMLParser which makes editing text a bit easier, but the wordpress like feeling is still missing.
What's missing is the automatic paragraph setting. That's something a subclass should add to the fragment after parsing. Difference mockup:
>>> simple.parse("Foo\n\nBar<em>blub\n\ntest", "blub")
<Fragment u'Foo\n\nBar<em>blub\n\ntest</em>'>
>>> autopar.parse("Foo\n\nBar<em>blub\n\ntest", "blub")
<Fragment u'<p>Foo</p><p>Bar<em>blub</em></p><p><em>test</em></p>'>
Change History
comment:1 Changed 5 years ago by mitsuhiko
- Priority changed from major to minor
- Type changed from defect to enhancement
- Component changed from admin to usability
- Milestone set to TextPress 0.1
comment:3 Changed 5 years ago by mitsuhiko
- Status changed from new to closed
- Resolution set to fixed
Added a parser that implements something similar in [94]. The difference to the proposal above is that it only adds paragraphs to the unnamed root element, inside divs or blockquotes and only if the tags are balanced.
Good:
This <strong>is</strong> foo! And this is bar. <div class="foo">Ha! Ha!</div>
Bad:
Foo <strong> bar</strong>
The latter just will not create a paragraph.
Note: See
TracTickets for help on using
tickets.