We have set a series of outbound rules to add some URL parameter at the end of every A HREF, AREA, BASE, FORM, FRAME, HEAD, IFRAME, etc. tags. Everything works fine.
The question we have is whether there is a way to restrict the scope of these rules only to a specific section of the HTML response (i.e. between two specific HTML comments). In other words we would like to have the rules behave as follows:
<html>
....
** NO RULES APPLIED HERE **
....
<!-- START SECTION -->
....
** RULES APPLIED HERE **
....
<!-- END SECTION -->
....
** NO RULES APPLIED HERE **
....
</html>
I think this is not possible but maybe one of you guys has a solution to this problem?
Thanks in advance,
-FG
Related
I have some text which is spat out if JavaScript isn't turned on and this is currently failing an accessibility test.
It is within a <noscript> tag but the accessibility test is saying that the text is not included within a landmark.
None of the 8 standard roles seem to cover this, and I can see there is a generic role.
Is it therefore okay to use:
<noscript role="generic">
Or is that going to be a poor user experience for someone with a screenreader?
Thanks
Just fleshing this out a bit.
So actually when javascript is disabled via developer tools, the code just gets spat out on the with no tags at all. Looks like:
<body>
"Please ensure Javascript is enabled for purposes of.....
<meta charset="UTF-8">............
The first landmark I can see is on the navigation so the message itself is not wrapped within another landmark.
It is being flagged an error because of:
https://www.w3.org/WAI/WCAG22/Techniques/aria/ARIA11
https://www.w3.org/WAI/WCAG21/Techniques/aria/ARIA20
https://alfa.siteimprove.com/rules/sia-r57
Based of the above, am I right in thinking I can either:
Wrap the message in <dialog>message to go here</dialog> OR
Bring the current message inside the <header> tag
I recently was using create-react-app and noticed that the <a> tag in App.js was using the noopener noreferrer attributes. I also noticed that scattered throughout our code-base, are <a> tags which do not use the above attributes.
I wanted to, using grunt-htmllint, add a rule that would enforce the adding of these attributes but am having trouble with the value that I should add to what I think would be "tag-req-attr".
The documentation for the rule is listed here, but the usage for me is confusing. How can I set the specified <a> tag to include said rules?
I am looking for a way to enforce that the rel attribute contains both noopener and noreferrere.g.:
My Link
Thanks
According to, https://developers.google.com/web/tools/lighthouse/audits/noopener, it looks like noreferrer handles both cases: rel="noreferrer" attribute has the same effect, but also prevents the Referer header from being sent to the new page.
In that case, simply using the link-req-noopener rule should be sufficient.
The rule "title" should be present in all pages is present on the Web Profile of SonarQube. I understand the reason why it exists but I am facing a situation where nothing can be done - so far - to avoid its violation. Let me explain...
When developing using primefaces if the header in xhtml is declared as just "head" tag it does not include some artificats that belongs to the primefaces framework. So, a xhtml like is required
<h:head>
<title>something</title>
....
<h:/head>
But this violates the rule I mentioned in bold.
Maybe because it checks html and xhtml files... not sure.
My thought about that was:
to edit this rule so it would recognize as a complaint code a h:head, or;
change the extension files this rule scans, or;
as last case disable it;
Any ideas about what to do and how to do it?
In html we can specify the charset for the whole document using:
<head>
<meta charset="utf-8" />
</head>
But sometimes, it is impossible to change the charset of the whole page, for example , using injection.
I would like to declare the charset for a specified element, like this
<span charset="utf-8">....</span>
but it seems it doesn't work.
Any ideas?
It is impossible to do this.
It is also difficult to design a way for this to work even theoretically. Think about it: the browser already parses your syntax using the charset. Considering implicit tag closing rules in HTML making this work would be difficult indeed.
What you can do is include an IFrame with a completely different document using a different charset.
To understand this limitation even better the meta http-equiv elements are not even part of the HTML document architecturally. Rather they are another way to specify HTTP headers if you cannot do it in HTTP server configuration.
I have two static html files, one is a design for a homepage, the other is a design for a regular page.
I have a rules to determine which one to use, like this:
<rules css:if-content="body.section-front-page">
<theme href="home.html" />
</rules>
<rules css:if-not-content="body.section-front-page"
css:if-content=".portaltype-document">
<theme href="index.html" />
</rules>
Though I am realizing now that these two pages have common elements, such as the header.
Is there a way to use the header from one page or something, that means if I make changes to the htmlt, it only needs to be done in one place? Another way of asking, can you mix together design files?
You would need to have just the one theme file to do that.
If you design the theme file properly and you do have common elements between the home page and the other site page templates this should be quite possible.
I guess the design is key here... the following site uses one theme file but has a very different home page using rules similar to your css:if-content="body.section-front-page" to determine not to show the left and right columns for example.
http://www.lotterywest.wa.gov.au/
This is not possible.
Diazo (version 1.0.4-py2.7) simply loads the theme file (see diazo.rules.expand_theme(element, theme_doc, absolute_prefix)). The loaded file must have a etree.parse()able format and AFIK there are no "rules" to embed or include further files or code.
I've been trying to find a workaround with no success until now. My alternative idea was to include the common code as a replace rule and then apply the other rules. E.g. have a given id in your theme-file and expanding it with a diazo rule. This works only if you do not need to expand your code (see my question https://stackoverflow.com/q/21703070/1659599).
If you only nedd to add html text without further replacements then you could add this by a rule.