Topic on Extension talk:Linter

星耀晨曦 (talkcontribs)

Hi, I posted a topic in Wikimedia Developer Support a few days ago. Can someone answer my doubts?

SSastry (WMF) (talkcontribs)

Location tells you the start and end offset within the wikitext source where the linter error can be found.

星耀晨曦 (talkcontribs)

How can I catch the error html? I queried it, the start is 2129 and the end is 2275. When I catch the html in my program, the program returns non-error html. There is my test code (written in PHP):

$start = 2129;
$end = 2275;
$obj = new HclearBot\APIRevisions( 3912458 ); // Where 3912458 is the page error
echo substr( $obj->getContent(), $start, $end - $start );

There is HclearBot\APIRevisions class for used to get revision..

The captured html is completely different from the html seen in the wikicode editor.

SSastry (WMF) (talkcontribs)

Also, note that the offsets are for wikitext strings in the page, not HTML.

SSastry (WMF) (talkcontribs)
星耀晨曦 (talkcontribs)

Oh, yes. I just need this answer. Thank you.