Age | Commit message (Collapse) | Author |
|
Doing everything on strings is kinda wonky, so this adds an intermediate
representation. The idea behind this is that the pipeline now goes
Wikicode [1]-> Document [2]-> Output String
Where step 1 takes care of templates and everything, and step 2 does the
actual output formatting. This has the benefit that we can support
multiple output types, some with more and some with less features (e.g.,
adding a Markdown output which keeps some of the original formatting
intact), and it has the benefit of being less wonky (no hacks with
"<!NUM!>" for numbered lists, more streamlined formatting with newlines,
...).
|
|
|
|
|
|
Cramming everything into a single file is not necessarily good, so this
patch splits it up a bit. Furthermore, the templates are no longer
hardcoded, but managed through a registry.
This breaks the lang-ar implementation, which was a weird special case
anyway. Properly fixing it would be to include all country codes.
|
|
|
|
|
|
|
|
|
|
|
|
Sometimes, lists are written like
*text
*text
Which can throw both the pattern-conversion and Gemini browsers off.
It's better to insert the extra space here and be safe.
|
|
Even though those macros are slightly different, we can handle them in
pretty much the same way (discard the meta information and just output
the characters).
|
|
|
|
|
|
This is not even a proper Python package yet, but the output is
surprisingly good already, so I'd like to take this version and save it.
|