The Trac ticket export/import process doesn't handle the following syntax correctly:
== NOTE ==
{{{ ... }}}
-- this does seem to come through OK in comments, presumably because we're converting those differentlyblah blah\n* foo\n* bar
\n
incorrectly introduced between "merged into" and "2.6 branch"----
for a horizontal line becomes a markdown heading if there is no blank line before itfoo <a b c> bar
Perhaps helpers.plain2markdown() will help.[http://google.com test]
work (I'm not sure) These are the issues I noticed - look through the Trac syntax reference to see if there are more.
Diff:
If we use the same process used for comments (converting HTML to markdown, instead of using Trac syntax), we'll be consistent in how we handle Trac text and it'll be a lot easier to fix these issues, rather than parsing & converting syntaxes.
allura:tv/6610
This is rebased to tv/6728, so that should be reviewed first.
I did a fresh gfarm import here: https://sf-tvansteenburgh-1020.sb.sf.net/p/test6549/gfarm-formatted/
Some tickets that show better formatting: 571, 612, 681, 594, 607
There's over-escaping in http://sf-tvansteenburgh-1020.sb.sf.net/p/test6549/gfarm-formatted/287/ Or maybe it's linkifying of #123 ticket references, which ideally wouldn't happen within pre-formatted text (
<code>
and<pre>
). html2text does that type of recognition (see itshandle_data
). Maybe we could hook into theescape_md_section
call and only replace links there?Can "Originally posted by:" in comments be italicized like is done for ticket body?
Rebased and force-pushed tv/6610
See https://sf-tvansteenburgh-1020.sb.sf.net/p/test6549/noshortlink2/287/ for fixed version of the same ticket.
You had mentioned (in private) a simple markdown parser/rewriter thing that you wrote for an earlier attempt on this ticket, and it might be good to re-use it for other things like [#6622]. Is that available somewhere?
Related
Tickets:
#6622From the looks of it, the whole
link_processing
method should go away, for the same reasons you removed theshort_link_ticket_pattern
part of it; right? Moreover,link_processing
is trac-specific so we don't want it in our genericimport_support.py
logic anyway.90e2f91..8d79813 tv/6610 -> tv/6610
Refactored and confirmed that the remaining parsing is still needed.