Page MenuHomePhabricator

Provide a wikitext mechanism to add <meta> tags to the page's <head> element
Open, LowestPublic

Description

MediaWiki apparently does not support the HTML tag <meta> in wikitext. I think the software should recognize this tag, since it facilitates for external software to easily recognize metadata such as author and publication date, which would be particularly useful for e.g. Wikiversity Journal of Medicine.

Event Timeline

Haggstrom raised the priority of this task from to Needs Triage.
Haggstrom updated the task description. (Show Details)
Haggstrom added a subscriber: Haggstrom.

Thanks for taking the time to report this!

Could you provide a specific example (link), the current situation, and the expected situation and behavior?

As far as i understand, <meta> tags always have to be in the <head> element of a HTML page, not in the body (content). As wikitext is content, I am not sure what exact expectations are described in this task.

If $wgAllowMicrodataAttributes is true (false by default) we allow meta in wikitext.

As far as i understand, <meta> tags always have to be in the <head> element of a HTML page, not in the body (content). As wikitext is content, I am not sure what exact expectations are described in this task.

In HTML5, there's some additional places it can appear when using microdata. See http://www.w3.org/TR/microdata/

What I would like is that the meta tags in the following article would work: https://en.wikiversity.org/wiki/Wikiversity_Journal_of_Medicine/Caesarean_section_photography

Currently, the tags are shown as regular text, as can be seen when clicking the "tags" word at top right.

When looking at the source code of the entire page, I see that there already is a <head> tag for the article. Eventually, I'd like a way to add this metadata to the actual <head> space. For now, the purpose is to run Altmetrics on articles like this, and we may find a way to run such analyzing on articles without having it in the top <head> section, so as a starter it would do good just to have <meta> tags rendered as HTML tags so that they become invisible when viewing the wiki page.

Currently, the main problem is that, instead of <meta>, these tags currently show as &lt;meta&gt; in the source code

What I would like is that the meta tags in the following article would work: https://en.wikiversity.org/wiki/Wikiversity_Journal_of_Medicine/Caesarean_section_photography

Currently, the tags are shown as regular text, as can be seen when clicking the "tags" word at top right.

When looking at the source code of the entire page, I see that there already is a <head> tag for the article. Eventually, I'd like a way to add this metadata to the actual <head> space. For now, the purpose is to run Altmetrics on articles like this, and we may find a way to run such analyzing on articles without having it in the top <head> section, so as a starter it would do good just to have <meta> tags rendered as HTML tags so that they become invisible when viewing the wiki page.

To be more specific, it appears he wants to be able to set meta tags in the <head> of the form:

`
<meta name="citation_title" content="Caesarean section photography">
<meta name="citation_author" content="Fadhley, Salim">
<meta name="citation_journal_title" content="Wikiversity Journal of Medicine">
<meta name="citation_volume" content="1">
<meta name="citation_issue" content="2">
<meta name="citation_pdf_url" content="https://upload.wikimedia.org/wikiversity/en/1/18/Caesarean_section_photography.pdf">
<meta name="citation_doi" content="10.15347/wjm/2014.006">
<meta name="citation_abstract_html_url" content="https://en.wikiversity.org/wiki/Wikiversity_Journal_of_Medicine/Caesarean_section_photography"
<meta name="citation_issn" content="2001-8762">
<meta name="citation_publisher" content="Wikiversity">
<meta name="dc.date.created" content="2014-07-20">
<meta name="citation_online_date" content="2014/07/20">
`

Yes, preferably. If that isn't possible, I'd like <meta> tags in the wikitext to show as <meta> in the source code rather than &lt;meta&gt;

Aklapper renamed this task from meta tags to Support adding further <meta> tags.Jul 27 2015, 7:15 AM
Aklapper triaged this task as Lowest priority.
Aklapper set Security to None.
Ciencia_Al_Poder added a subscriber: Ciencia_Al_Poder.

As said by Bawolff in T106990#1483597

If $wgAllowMicrodataAttributes is true (false by default) we allow meta in wikitext.

Basically you're asking to set $wgAllowMicrodataAttributes = true; on WMF wikis.

Framawiki added a subscriber: Framawiki.

Basically you're asking to set $wgAllowMicrodataAttributes = true; on WMF wikis.

Maybe not, we're talking about wikisource, an open wiki and editable by anyone. Enabling the function would result in a significant security risk (adding anything to the header of any page)?

Perhaps the best solution would be to make an extension that, with a particular syntax or keywords, safely adds citation meta tags.

Ok, maybe I did not understood the problem correctly. With $wgAllowMicrodataAttributes = true;, <meta> tags are allowed on wikitext, but only as a normal element in the same place where they appear in wikitext, they aren't put in the <head> section.

If those meta tags should be in the <head> section of the HTML, then $wgAllowMicrodataAttributes = true; will not be sufficient and indeed an extension would be required for that.

Jdforrester-WMF renamed this task from Support adding further <meta> tags to Provide a wikitext mechanism to add <meta> tags to the page's <head> element.Jun 11 2018, 7:42 PM

Re-titled to represent the actual request here; wgAllowMicrodataAttributes has been true (and ignored) since REL1_27. Currently the Parser's sanitiser allows 'meta' => [ 'itemprop', 'content' ] only; there's nothing specific to Wikimedia wikis yet.

AFAICT this seems like it's being Declined?