Topic on Extension talk:CodeMirror

Reptilien.19831209BE1 (talkcontribs)

Hello, Is that possible to add an overlay for specific highlighting ? I tried something but that doesn't work. An idea ?

NKohli (WMF) (talkcontribs)

Hey @Reptilien.19831209BE1 can you describe what you want to do a bit more? You can definitely change the styling for any of the wikitext markup pieces in the text. What do you mean by an overlay here?

Reptilien.19831209BE1 (talkcontribs)

Wikitext markup is not concerned by what I'd like to do. In French Wikisource, we have a gadget that detects some frequent typo and OCR mistakes in the parsed text (HTML): like " ' " (U+0027) that should be " ’ " (U+2019), or "1e" instead of "le". It's very usefull and I'd wish to detect these mistakes in the text highlighted by CodeMirror (example: "d'acier" → "d’acier"; "lorsqu’on" → "lorſqu’on"; "dcs" → "des"). CodeMirror API allows us to add a new layer with the method cm.addOverlay, but I don't know how to get (with MediaWiki) the CodeMirror extension object to do this. I hope it's a bit clearer. :-\

Reply to "addOverlay()"