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 = _{ newline | para | text | string | space | other }

text = @{ (!para ~ ANY)+ }
string = ${ "{" ~ fn_name* ~ (string_bracket | string_val) ~ "}" }
string_bracket = ${ "(" ~ string ~ ")" }
string_val = @{ (!("}" | ")") ~ ANY)*  }

para = ${ function | section }

fn_name = @{ "\\" ~ ASCII_ALPHA+ ~ ("["~ " "* ~"]")* ~ " "* }
function = ${ fn_name ~ (function | string) }

section = @{ "%" ~ (!newline ~ ANY)+ } 

other = ${ ANY }

newline = ${ "\n" | "\r" }
space = ${ " "+ }