2021年3月21日星期日

Removing Formatting: WikiText (JavaScript)

I'm using an API that collects the source code from MediaWiki pages and am hoping to find a way to extract the plain text from the code. Is there any way to remove this extra formatting?

Example:

Text from API

This is a [[page hyperlink]]. This is <small>small text</small>. This is a === Header ===  

Text I want to extract without formatting

This is a page hyperlink. This is small text. This is a Header  

Does anyone know how this can be performed in JavaScript? Or a node module that can execute this?

https://stackoverflow.com/questions/66739151/removing-formatting-wikitext-javascript March 22, 2021 at 09:04AM

没有评论:

发表评论