Comments (1)
We could steal a MAGIC character slot, replace -{}-
with it, and then change it back as needed.
In common we have:
https://github.com/tatuylonen/wikitextprocessor/blob/03d2312b6c59ece309c99e5b013d2dfe96473637/wikitextprocessor/common.py#LL8C1-L17C2
The magic characters and the range are just unused Unicode characters that should be safe to sprinkle into strings.
Here we could add a MAGIC_ZH_PLACEHOLDER by shifting MAGIC_FIRST to 0x0x00102040 and giving 0x0010203f to MAGIC_ZH_PLACEHOLDER, cast it as a character in MAGIC_ZH_PLACEHOLDER_CH and do string replacements back and forth between the magic character and -{}-
as needed.
(Note to self: replace magic values with MAGIC_BASE_VALUE + N.)
This is what I did when I needed to somehow fix an issue with quote single quote '
apostrophes inside double-quoted HTML attributes when parsing.
from wikitextprocessor.
Related Issues (20)
- zh edition dump missing many entries HOT 12
- Update README.md API section to mention need to iterate over Wtp.process() return value. HOT 4
- Parser chokes on valid HTML attribute that looks like Wiki text HOT 3
- Parser fails on HTML tag spanning multiple lines HOT 3
- Typo in README
- Lua parsing broken with (...) and `arg` HOT 3
- Differences between Lua versions : Invalid escape sequence near '".+\/' HOT 1
- HTML code in English word senses HOT 8
- The word senses for benzylidene are also not being parsed correctly. HOT 2
- Lua: differences in __tostring() between 5.1 and later? HOT 1
- Performance improvement ideas HOT 24
- {{trans-top}}{{multitrans}} cause misparsing when there is no newline between them HOT 2
- --categories-file is currently broken HOT 3
- Pages folder missing Modules and Templates, and issues with colons in word titles
- Major issues with Lua memory stuff not resetting properly HOT 20
- Detecting whether a page contains an entry for a specific language HOT 4
- Cannot import 'Page' HOT 2
- Filenames cause errors on exFAT HOT 4
- Paser can't parse templates that have `{}` in arguemnt
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wikitextprocessor.