punctilio 1.8.1 → 1.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -78,7 +78,7 @@ Setting aside the benchmark, `punctilio`’s test suite includes 1,100+ tests at
|
|
|
78
78
|
|
|
79
79
|
## Works with HTML DOMs via separation boundaries
|
|
80
80
|
|
|
81
|
-
Other typography libraries either transform plain strings
|
|
81
|
+
Other typography libraries either transform plain strings (`retext-smartypants` [can’t map changes back to HTML](https://github.com/rehypejs/rehype-retext)) or operate on AST nodes individually. But real HTML has text spanning multiple elements—if you concatenate text from `<em>Wait</em>...`, transform it, then try to split it back, you’ve lost track of where `</em>` belonged.
|
|
82
82
|
|
|
83
83
|
`punctilio` introduces _separation boundaries_. First, insert a “separator” character (default: `U+E000`) at each element boundary before transforming (like at the start and end of an `<em>`). Every regex allows this character mid-pattern without breaking matches. For example, “`.[SEP]..`” still becomes “`…[SEP]`”. `punctilio` validates the output by ensuring the separator count remains the same.
|
|
84
84
|
|