https://github.com/longbridge/autocorrect/releases
Format
,FormatHTML
,Unformat
,UnformatHTML
support custom option for addition processes.
Example:
type myFormatter struct {}
func (my myFormatter) Format(text string) string {
return strings.ReplaceAll(text, "ios", "iOS")
}
autocorrect.Format("新版本 ios 即将发布", myFormatter{})
// "新版本 iOS 即将发布"
- Fix fullwidth to remove
;
for fix invalid convert with HTML Entity case.
- Auto correct punctuation into fullwidth.
- Change rule for ignore spacing between
#
,$
chars.
- Fix some break line miss bug.
- Add
Unformat
/UnformatHTML
method for remove spacings.
- Use new HTML parser to format HTML for performance up.
- Avoid format text with script/style/textarea/pre tags.
- Fix halfwidth to correct fullwidth spaces.
- Auto correct FullWidth -> halfwidth for Letters, Numbers, and Colon in time.
- Avoid create regex on format method call for performance up (~40%).
- Add Full CJK (Chinese, Japanese, Korean) support.
- Fix space around
-
;
- Fix add space round
*
;
- Fix HTML replace when content has escapeable
&
,
chars.
- Rename package from
autospace
toautocorrect
.
- Add
FormatHTML
method for process HTML contents.
- First release.