Notepad++ doesn't highlight the attribute autofocus - html

Notepad++ does not highlight autofocus as red like it does to the others attributes.
Is that the intended behavior, am I doing something wrong, or is it a bug?I don't suppose it's possible to just add the keyword myself, right?Let me know if there's anyway to fix this problem.

Notepad++ has its own idea of the syntax of HTML. This may vary by Notepad++ version; the current version (7.3.2) does not seem to recognize contenteditable and spellcheck either – they are, like autofocus, shown in the settings for ATTRIBUTEUNKNOWN. If you like, you can use the Style Configurator (in the Settings menu) to set that rendering to the same as for ATTRIBUTE, but then you would also see e.g. attributes conteteditable and foobar in that color, too.
There does not seem to be any way to change the set of recognized attributes except by editing the source of Notepad++. In the Language menu, there is the option “Define your language”, but it is far from obvious how to use it to define your own version of HTML. It seems that the formalisms used are limited, since Notepad++ seems to show e.g. the tag <action> in the color for recognized tags, probably because action is a valid attribute name and the Notepad++ definitions for HTML have a list of keywords, including both tag and attribute names.
So don’t take the syntax highlighting and coloring in Notepad++ too seriously. It usually helps, but it’s far from perfect and should not be taken as a criterion for syntactic correctness.

Related

NetBeans Highlighting Issue in HTML

I'm using NetBeans 12 and I hate the fact that it highlights all instances of classnames in HTML and leaves them highlighted with no apparent way to remove the highlighting until another classname/id is selected.
I have searched for answers, and a common one is to use Tools > Options > Editor > Highlighting and deselect "mark occurrences of symbol under carat." I think that is for a different problem though, and for some reason the only language in the dropdown is PHP, so I can't uncheck this for HTML anyway.
Please tell me how I can stop this annoying behaviour, or at least use a keyboard shortcut to remove the highlighting. I would have though something like ESC would be set up to do this as default, but no...
Go to Tools > Options > Fonts & Colors
There you will see a drop-down list of different style profiles. In my case, I have "FlatLaf Light" selected. Yours may be different, but that should not matter.
Choose the "Syntax" sub-menu.
In the "language" list choose "HTML"
In the "Category" list, scroll down to "CSS embedded in HTML" and then select it.
Change the "Background" color to "Inherited".
Hit "Apply" to save your changes.
In my case, this looks as follows:
Before the change:
After the change:
This changes the (very specific) highlighting issue shown in your question's screenshot. But you may want to make a similar change in other places... For example, you can see the opening and closing (matching) <ul> tags are highlighted (which I find useful).
So, you can also take a look at other languages - and even the "All Languages" option for a broader range of places where similar changes can be made (e.g "Mark Occurrences"). But I have not investigated these in any detail.
Final notes - all subjective and based on personal preferences...
You may choose to keep the highlighting feature, but to use a less intrusive color, of course, instead of completely removing it.
I am using NetBeans 15 - so that may affect which overall look and feel themes you have available, also. But a different theme (retaining the highlighting) may also be another option.

Hyphen in custom HTML-tags

I want to use custom tags at my page.
I've read that custom tags must contain a hyphen like this: <my-element></my-element>.
What will happen if I call my tags without hyphen: <myelement></myelement>?Will it affect the search engines or other consequences?
I'm sure it is not a requirement "because otherwise doesn't work". Maybe that advice is just to ensure you don't override a legacy tag and get puzzled with the fact something works in the way it's not documented.
There's definitely no problem with defining, styling and doing something via js with a tag without hyphens at all and I've practiced it and had no issue. Neither vanilla javascript nor jQuery cares about hyphens in your tags.
As for search engines - it would be very weird if search engines take account of the fact whether the tag contains the hyphen at all or not. It's like saying "will search engine penalise my page if my javascript doesn't work correctly", i.e. something that search engine is not supposed to check at all. The hyphens are just about your coding coding habits - use them if you like them.

Can I stop ReSharper objecting to Ionic HTML tags?

I've just opened my first Ionic based mobile project, and the HTML templates are really full of Ionic tags, like <ion-modal-view>, which courtesy, ReSharper (I deeply suspect), has a wavy blue underline, as do half the other tags in the template. I deplore working with these lines on the screen, as they indicate there is something wrong (OK, maybe for the W3C it is wrong), when there is nothing wrong. Can, and how, I get rid of these damned blue lines?
Well I'm a big believer in writing valid html. Standards are there for a reason, and we can't complain about Microsoft not following them with IE if we don't follow them ourselves.
I did some searching and couldn't find any information on whether Ionic could be written as valid html.
So personally were I in your position I'd either consider whether writing an XHTML DTD that supported Ionic's mark-up was an option, or chose a framework that I could write valid mark-up in.
Since I'm guessing neither of those is an option you could go to:
Resharper -> Options -> Code Inspection -> Settings
Look for the section under the heading Elements to skip -
Either find File masks and add *.html (or whatever other file extension you might be using) or find Files and folders and mark the specific files/folders that you don't want Resharper to look at.
I want to suggest a better alternative.
Instead of skipping inspections of all *.html files it should be possible to just ignore the inspection for Unknown Tags:

how to use an html entity as text

I am making a developer page for my website, and I have HTML code for a button to put into their own website. But the code for them to copy has an entity in it, and I need the entity to appear as text. Can anyone help?
HTML:
<button id="b">0</button><div id='votes'>&Leftarrow;</div>
P.S. The HTML entity is &Leftarrow
If you want the text
<button id="b">0</button><div id='votes'>&Leftarrow;</div>
to appear on the page, as it seems, write it as
<button id="b">0</button><div id='votes'>&Leftarrow;</div>
That is, the code in the question but the ampersand & before Leftarrow escaped as &, by normal HTML rules.
However, the character reference &Leftarrow; is an addition in HTML5 and not supported by older browsers. It is a pointless risk to use it, instead of the HTML 4 entity reference ⇐, which is considerably more widely supported. Or you could enter the character “⇐” itself, provided that developers know how to use UTF-8 property, as they should.
The entity &Arrowleft mentioned in the question does not belong to any HTML version. The names of entity/character references for arrows are very confusing (who would have guessed that &LeftArrow; and &leftarrow; are the same thing, but different from&Leftarrow;?), which is yet another reason to use the character themselves, or numeric references like ⇐.
Note that independently of these notational issues, the character “⇐” is has limited font support. If you only use it in an icon-like manner, using an image, with an adequate alt text, is probably a safer option.
Use this chart http://dev.w3.org/html5/html-author/charref as guidance, and replace the HTML entities with their corresponding entity reference. So if you have < use < instead, for example.
Use this markup:
<button id="b">0</button><div id='votes'>&leftarrow;</div>
If you're posting this into some kind of CMS and it's changing your code, try wrapping everything in <pre></pre>.

aptana html highlighting not working well

I just downloaded Aptana (v3.0.4) and I'm really liking it, much better for coding than Dreamweaver. The big problem I've found so far is that I can't get the HTML highlighting to work properly.
For example, I go to the Theme selector and choose one theme (in this case the Dreamweaver theme, since I'm already used to those colors). It works fine for php, javascript, css... but for HTML. It won't give different colors to the different html tags (like "a", "img", "form", etc). If I look at the colors palette, I can see that those tags have different colors assigned, but no matter what color they have in the palette, they take the color of the "html meta" element in the palette. So basically, ALL the tags have the same color, which is annoying.
Is there any way to fix this? I've even created a new theme copying the Dreamweaver one to make modifications, but still the same...
EDIT
It seems that this might have something to do with Scopes. The coloring rules work assigning a color to a certain scope (each coding element has one scope linked to it). In the colors palette, each of the html tags ("a","img",etc) has a different scope linked to it. However, if I use the Show Scope tool that Aptana has, all those elements show the same scope: text.html.basic meta.tag.block.any.html entity.name.tag.inline.any.html, instead of showing a different one each one. So since they all have the same scope, using the them editor you can't choose a different color for each one... Is there any other way to do it? Is it possible to change the assigned scope of an element?
These operations behave similar to CSS Selectors.
GO => entity.name.tag.inline.(form, img, p, etc.).html.
(1) OPEN the Preferences Theme Panel.
(2) ADD (+) a NEW element.
(3) SELECT your desired STYLES.
(4) PASTE your desired scope selector, e.g., "entity.name.tag.inline.form.html" INTO the Scope Selector FIELD… and CLICK 'Apply'.
(5) PRESTO CHANGE-O!
All HTML tags currently have the same scope, so you can't (yet) do what you are asking. But please file a feature request so it can be added to the list.
maybe check the default editor for html files in aptana?
Anyway, my aptana had always the same color for each tag.