autocorrect 1.10.7

A linter and formatter for help you improve copywriting, to correct spaces, words, punctuations between CJK (Chinese, Japanese, Korean).
Documentation
item = _{ SOI ~ line* ~ EOI }
line = _{ expr | text | newline }

expr = _{ meta_info | codeblock | inline | td_tag | block }

inline = _{ comment | img | link | mark | wikilinks }
block = ${ block_prefix ~ space ~ inline* ~ string }

newline = ${ "\n" | "\r" }
space = @{ (" ")* }
codeblock = ${
  PUSH("```") ~ codeblock_lang ~ codeblock_code ~ "```"
}
codeblock_lang = { ASCII_ALPHA* }
codeblock_code = { (!(PEEK) ~ ANY)* }
td_tag = @{ space ~ "|" ~ space }
mark_tag = @{
  "**"
  | "*"
  | "~~"
  | "`"
}
block_prefix = @{
  "######" | "#####" | "####" | "###" | "##" | "#" | "*" | "-" | ">"
}

meta_info = ${ PUSH(meta_wrap) ~ newline ~ meta_pair* ~ meta_wrap ~ newline* }
meta_wrap = @{ "-"{3,} }
meta_pair = ${ meta_key ~ string ~ newline }
meta_key = @{ (!":" ~ ANY)* ~ ":" ~ " "* }

image_prefix = @{ "!" }
img = ${ image_prefix ~ link }

link = ${ link_string ~ link_url }
link_string = { "[" ~ (!("]" | newline) ~ ANY)* ~ "]" }
link_url = { "(" ~ (!(")" | newline) ~ ANY)* ~ ")" }

wikilinks = ${"[[" ~ (!("]]" | newline) ~ ANY)* ~ "]]" }

mark = ${ PUSH(mark_tag) ~ mark_string ~ mark_tag }

text = { (!(expr | inline | newline) ~ ANY)+ }
string = ${ (!(newline | inline) ~ ANY)* }
mark_string = {(!(PEEK | newline | inline) ~ ANY)* }

comment = ${ comment_tag_start ~ (!comment_tag_end ~ ANY)* ~ comment_tag_end }
comment_tag_start = @{  "<!--" }
comment_tag_end = @{ "-->" }