Page MenuHomePhabricator

Strip comments from fields during harvest
Closed, ResolvedPublic

Description

It looks as though comments (<!-- [...] ->>) are being included during the harvesting and as a result lat/lon are returning incorrect values (for e.g. https://ca.wikipedia.org/wiki/Llista_de_monuments_d'Arb%C3%BAcies ) [T39422].

These comments should be striped out as part of extract_elements_from_template_param(). The question is whether these, like references, can be assumed to always be at the end of the value?

Event Timeline

JeanFred triaged this task as Medium priority.EditedMay 9 2016, 12:27 PM
JeanFred subscribed.

Good catch.

The question is whether these, like references, can be assumed to always be at the end of the value?

We can just use a regex (aargh) to remove /<!--.*-->/ anywhere in the string?

Should work. That might also be a safer way of dealing with the <ref> tag.

Change 287792 had a related patch set uploaded (by Jean-Frédéric):
Strip wikitext comments out of parsed values in templates

https://gerrit.wikimedia.org/r/287792

Change 287792 merged by jenkins-bot:
Strip wikitext comments out of parsed values in templates

https://gerrit.wikimedia.org/r/287792

Mentioned in SAL [2016-05-12T13:04:30Z] <JeanFred> Deployed latest from Git: ebcd48c (T134727)

JeanFred claimed this task.