dahlia / seonbi

SmartyPants for Korean language

Home Page:https://hackage.haskell.org/package/seonbi

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Plain text mode besides (X)HTML mode

dahlia opened this issue · comments

Seonbi currently provides two modes for input/output formatting:

  • HTML
  • XHTML

However, sometimes we need to apply adjustments on text before it's compiled to HTML, or it won't be compiled to HTML at all. For such demands, it's good to have one more mode: plain text.

Fortunately, it apparently is not that difficult to implement:

  1. Escape the whole input to HTML character entities (or simply put it to a CDATA section).
  2. Make adjustments on it.
  3. Unescape the whole output.

Now the Boolean option xhtml is replaced by the new option contentType, which should be one of text/html and application/xhtml+xml. Two tasks to do remain:

Now we have 4 modes:

HTML, XHTML, Plain text, Markdown

Thank you 👍🏼