V9: clean wikitext replace for bot-plugins
See original GitHub issueIs there any way to get the original wikitext for a specific model? Not converting it back like wtf-plugin-wikitext
does, but like a startIndex
, endIndex
into the originally parsed wikitext string?
I want to be able to convert back to wikitext
while keeping the originally desired user formatting, just changing the text in one or two rows of a table.
Almost something like
const [brandTable] = tldDoc.sections('Brand top-level domains').tables();
brandTable.data
.map(r => {
if(r.Name === '.somebrand') {
r.Name = new Sentence('');
return r.wikitext(); //It's a table _row_ so it doesn't really have that but I can manage on my end
}
else {
return r.originalWikiText(); //Just returns the original wikitext for that row
}
})
.join('\n');
…where r.originalWikiText()
would basically just, return the
Is this even possible? Could the parser decorate the models with this information? Is this something that would be valuable in a PR? Trying to write a Wikipedia bot that updates a table…
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Extension:Replace Text - MediaWiki
Extension:Replace Text ; Description, Provides a form to let administrators do string replacements on the entire wiki, for both page contents and page...
Read more >Untitled
Libertinism in restoration theatre, Petaluma adobe wiki. ... Belinda stajan, Nrgeek unboxing, Mapas estelares gratis, Cm1836 replacement blade?
Read more >Untitled
Septic pipe replacement cost, Que es shunt electrico, Graham and brown saville wallpaper ... Jules destrooper wiki, Hans peter waldhoff, Celebrazione inizio ...
Read more >Untitled
Perii usi culisante, Npt council environmental health, Dism cleanup server 2008 r2, ... Define trilete mark, Febdok alternativ, Newton streamline wiki, ...
Read more >Help:Wikitext - Wikipedia
The markup language called wikitext, also known as wiki markup or wikicode, consists of the syntax and keywords used by the MediaWiki software...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
yep - I’ve been thinking about this too. Let me take a crack at it, i’ve got some time over the holidays. I don’t have any clear ideas, but maybe it will help to just try a few things. will let you know how it goes
hey @Cobertos - I haven’t got a solution to this, but haven’t forgotten.
Plan is to do a fuzzy-match on the original wikitext, then allow replacing chunks of it - hard part is that the model isn’t built-well for reproducing subsets of the document, like the table use-case you mentioned.
I will almost-certainly be over-thinking this over the winter, but should scale-back my promises for it. cheers