Jump to content

Extension talk:HTML Tags

Add topic
From mediawiki.org
Latest comment: 18 hours ago by Senouis in topic Cannot allow <canvas> tag
[edit]

At the end of the sentence : You can download the HTML Tags code, in .tgz format, here.


Thanks Nicolas NALLET (talk) 16:24, 4 November 2012 (UTC)Reply

Oops! That was a copy/paste error. Thanks for pointing that out; it's fixed now. Yaron Koren (talk) 17:22, 4 November 2012 (UTC)Reply

Ok thanks it works great ! both download and extension !

Nicolas NALLET (talk) 11:47, 5 November 2012 (UTC)Reply

It's great to hear that the extension is working for you! Yaron Koren (talk) 13:22, 5 November 2012 (UTC)Reply

Application example : displaying a web site screenshot thumbnail

[edit]

This extension allows to easily display a website screenshot thumnail with the help of a website screenshot provider.

You can see an exemple here

Cool! Yes, I guess there's no way right now in MediaWiki to have an external image that links to another URL. Yaron Koren (talk) 19:54, 5 November 2012 (UTC)Reply

About Microdata

[edit]

I originally figured that it might be an idea to add this reference since the intro already referred to some kind of Metadata. However I was indeed not telling the whole story. Most Microdata may be added without using this extension, but I think one is lost when trying to add Breadcrumbs data without using this extension. Cheers --[[kgh]] (talk) 06:54, 22 May 2014 (UTC)Reply

Oh, okay - I really don't know that much about microdata stuff. I just added in a modified version of what you wrote - hopefully it make sense... Yaron Koren (talk) 00:17, 23 May 2014 (UTC)Reply
That's great and thank you for improving the note. I think this will also increase the overall usage of this extension. No worries about microdata. I just started to dig in into it. It's another way to help search engines to grab content more meaningful way. Cheers --[[kgh]] (talk) 08:38, 23 May 2014 (UTC)Reply

Doesn't work with nested tags

[edit]

When you use nested tags, the first </htmltag> closes the first opened tag, and not the last opened one. As a second point, the inner <htmltag> doesn't close, instead the </htmltag> is written in the document Example:

<htmltag tagname="x">
<htmltag tagname="y">
</htmltag>
</htmltag>

results in

<x>
<y>
</y>
</htmltag> <--written, not as a html tag
That's too bad... I never thought about the nested thing. I can't think of any way to that get working easily, unfortunately; you may have to use some other method, like the Widgets extension. Yaron Koren (talk) 01:32, 8 July 2014 (UTC)Reply
You can always use the wiki tag parser function:
{{#tag:htmltag|<htmltag tagname="Y"></htmltag>
|tagname=x
}}
Wess (talk) 19:36, 16 March 2017 (UTC)Reply

Specific Pattern in Attributes

[edit]

Hello,

Is it possible to allow a certain pattern for attributes? E.g if I wanted to allow a specific domain to be in iframe tag's src attribute.--194.150.65.139 09:11, 5 November 2016 (UTC)Reply

No, unfortunately. Yaron Koren (talk) 02:36, 8 November 2016 (UTC)Reply
Any plans on including the feature? --Id508317 (talk) 12:29, 8 December 2016 (UTC)Reply
No - although I'd be happy to accept a patch that does this. Yaron Koren (talk) 13:52, 8 December 2016 (UTC)Reply

how should do to add <div itemscope itemtype="http://schema.org/JobPosting"> ?

[edit]

how should do to add <div itemscope itemtype="http://schema.org/JobPosting"> ?

Consider using Manual:Hooks/OutputPageBodyAttributes. Here's what I did to add support to Extension:BreadCrumbs2 to make it a WebPage.
$wgHooks['OutputPageBodyAttributes'][] = 'addBreadcrumbSchemaBodyAttributes';

function addBreadcrumbSchemaBodyAttributes( OutputPage $out, Skin $skin, &$bodyAttrs ) {
        $bodyAttrs['itemscope'] = '';
        $bodyAttrs['itemtype'] = 'http://schema.org/WebPage';

        return true;
}
... $breadcrumbHTML =  Xml::openElement( 'div', array ( 'id' => 'breadcrumbs2', 'itemprop' => 'breadcrumb' ) ) . $breadcrumb . Xml::closeElement( 'div' );
You seem to need to use the empty string and be happy with itemscope="" as a result, it doesn't accept null or false - this shows up OK on Google's structured data tester, though it didn't seem to work so well on the Rich Results Tool. GreenReaper (talk) 21:43, 22 February 2021 (UTC)Reply

id is missing

[edit]

Hi,

sadly it seems, that a set id attribute will not transfered trough the parser. Is there any way to provide this? --Gunnar.offel (talk) 00:47, 18 December 2019 (UTC)Reply

[edit]

I have exchanged the ZIP-Download link to the GIT-Master Zip link. If it is not correct please change it to whatever is correct, but the version which was downloaded before that was not working at all. --DesignerThan (talk) 13:02, 6 January 2021 (UTC)Reply

Indeed the link was outdated. However changing to master unconditionally is not a good idea either in case of possible breaking changes in the future. Thus I changed to the hash of current master. Cheers --[[kgh]] (talk) 22:25, 6 January 2021 (UTC)Reply

Not restricted HTML Code as content

[edit]

Hello, for a project I need to have a span inside of a button tag which is outputed with the HTMLTag Parser function. Is it possible to do that? That is the example code. <htmltag tagname="button" class="dropdown-toggle dropdown-toggle-split" type="button" id="dropdownAnswerKeys" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Toggle Dropdown</htmltag>

Thank's for helping me. --DesignerThan (talk) 21:51, 3 May 2021 (UTC)Reply

The attribute "tagname" must be set for this tag.

[edit]

Error

What does it mean. Wikedneeded (talk) 11:38, 12 June 2021 (UTC)Reply

in case my contributions are delated A more detailed version is available here

[edit]

https://www.mediawiki.org/w/index.php?title=Extension:HTML_Tags&oldid=4635947 Wikedneeded (talk) 12:00, 12 June 2021 (UTC)Reply

Wikicode not parsed by design?

[edit]

Is it by design that a wikicode within the tag is not parsed?

Code like:

<htmltag tagname="cite">- This links to [[Some page]]</htmltag>

results in

- This links to [[Some page]]

and the wikilink is not resolved. Is this an intended behavior? --Luca Mauri (talk) 08:05, 18 September 2021 (UTC)Reply

Same questions here. Seems weird to allow some html tags but at the same tim undo wikitext in the tags. Eric L8s (talk) 17:29, 10 February 2023 (UTC)Reply
+1 from me. BjsMimot (talk) 06:14, 5 September 2023 (UTC)Reply
Sorry, I might have missed all this previous discussion. Why would you need to use <htmltag> for something like <cite>? (Which, by the way, is a tag function, not an HTML tag.) Yaron Koren (talk) 13:33, 5 September 2023 (UTC)Reply

FYI: When "Deprecated: strlen(): Passing null to parameter #1 ($string) ..." message is shown on the top of the page including <htmltag>

[edit]

I'm using this extension to show external image.

I've noticed that the warning message is shown just as below when using <htmltag> on Mediawiki 1.42.1:

Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/html/includes/parser/Parser.php on line 2947

I figured out that the message is shown when we use <htmltag> as self-closing tag, like <htmltag ... />. So specifying closing tag(</htmltag>), not using self-closing tag, eliminates the message. Quiraxical (talk) 14:15, 26 August 2024 (UTC)Reply

Cannot allow <canvas> tag

[edit]
  • Tested in MediaWiki 1.41.1

I had installed this extension and some tag could be allowed to edit. But when I add canvas tag to my wiki page with proper settings, it said htmltag doesn't support canvas tag at all. I cannot understand this situation, because canvas tag itself is not such harmful and can make dynamic changes to wiki page. For example, the operator can add web game loading with Extension:Gadgets and proper CORS policies. I think this extensions should support canvas HTML tag. Senouis (talk) 22:15, 20 December 2024 (UTC)Reply