Fiddler JS formatter extension to format html conditionally - fiddler

Related to: Is there a way for Fiddler JS formatter extension to work conditionally?
As far as i know that js formatter extension is based on js beautify project, and js beautify support formatting html and scripts inside them but when i use the same code that is provided in the related question which is :
if (oSession.oResponse["Content-Type"].ToLower().Contains("text/html")) {
oSession["X-FIDDLER-JS-FORMAT"] = "yes";
}
I would get a messed up html structure and firefox can't show the html properly
If i used X-Format-JS instead of X-FIDDLER-JS-FORMAT flag in the code above, then no formatting happens at all, so how to make js formatter formats html responses ?

No, Fiddler isn't based on JSBeautify and no, it doesn't support automatic formatting of JavaScript inside HTML.

Related

auto close HTML tags is not triggering

According to this update, VS Code is supposed to auto close tags when the closing > of the opening tag is typed. Mine won't seem to do that (I'm on v1.19).
I also tried installing the package Jun Han made which is supposed to do this too, but it doesn't work. Is there a trick to getting this function to work?
Enabled extensions are:
I've also experienced inconsistencies with this feature.
Tag elements are now automatically closed when > of the opening tag is typed
This only seems to work when the file is detected as plain HTML or JS.
The matching closing tag is inserted when / of the closing tag is entered
This works for HTML and JavaScript, and for other formats that render HTML like Vue or Markdown.
There are some settings you can check if it's not working:
Make sure html.autoClosingTags is true
It should be true by default
Check your user, workspace, and folder settings (maybe one is overriding it)
If you still have the Auto Close Tag extension installed:
auto-close-tag.excludedTags
auto-close-tag.activationOnLanguage
If the detected language is not HTML or JavaScript, check that it is on this list
auto-close-tag.fullMode
The default is false, but setting to true makes it seem more consistent
I had the same problem. After reviewing the answer above, I noticed that VS Code auto-detected a different language than HTML, even though the file I was editing had the ".html" extension. After selecting HTML as the working language, the editor now auto-closes the tags.

How to tell which formatter is being used?

I am working with some Laravel Blade PHP templates. When I format the document either when saving or when running the "Format Document" command, some formatting happens that I don't like, for some example certain Blade-template-specific commands wrapping to the next line when I don't want them to.
My question is, when you run "Format Document" in VSCode, how can you tell what "formatter" is being used? In this case, is it using an HTML formatter, or a PHP formatter or a Laravel Blade formatter? I would like to know this so that I can figure out how to change how the formatter is doing things if possible.
I have some Laravel snippets extension installed as well as some PHP extensions. Can't tell what formatter is being used though.

Tinymce Plugin Rendering Source Code With Form Results

I am using Tinymce in a textarea form field to add 'Rich text Editing' to the field. (Form Method = POST).
I used this tutorial to install the files.
In the form itself.. the editor works great.
However....
ISSUE: When my form results are produced, the results include the raw text and source code, instead of the formatted text.
Obviously... the Tinymce plugin has several files and folders. But....
If anyone has experience with the Tinymce plugin, perhaps I am making a rookie, generic, first time error???
Any guidance would be helpful. Thanks.
I figured it out. In my php, I just had to remove htmlspecialchars

Netbeans: Syntax Highlighting -- multiple languages per file

The majority of the pages I author contain both HTML and PHP. It would appear that in Netbeans you can have syntax highlighting for one or the other by setting the associated file types.
Coming from Notepad++, I've always taken for granted the fact that I could use php, css, html, javascript all in one file and retain syntax highlighting for all of them.
Is this possible in Netbeans?
I think the answer here is that Netbeans DOES support multiple language, but it will only get it right if there's something hinting at the "inner" language. When I exit PHP with ?> NetBeans tends to format what comes before the next <?php as HTML automatically. Not sure if that is working for you. Maybe you were trying to get highlighting in a string like $output = "<some><html";. I think you can imagine why that second one wouldn't work.
For JS, for example, it seems to look for the <script type="text/javascript">, and stuff inside gets the JS highlighting even if the file type is PHP.
This other question has a great solution for "tricking" Netbeans into rendering your JS output by PHP into being formatted, even when your code doesn't have a <script type="text/javascript"> tag.

Disable XHTML validation in Netbeans for dojo developing

I am developing a dojo application in Netbeans 7.1, however since dojo uses non standard HTML attributes, I have XHTML validation errors in every line.
Within Netbeans there is the option to completely ignore this errors for a specific line or for the whole document, bu I would like to keep basic html validation on.
Is it possible to have this errors ignored without loosing html validation ?
Dojo supports also valid data- HTML attributes, use those:
data-dojo-config not djConfig, e.g.: data-dojo-config="parseOnLoad:true,async:true"
data-dojo-type instead of dojoType
data-dojo-props e.g.: data-dojo-props="name:'start_date',required: true"
data-dojo-attach-point in widget templates
data-dojo-attach-event in widget templates
data-dojo-id instead of jsId
Edit: Since data-* attributes are valid only in HTML5 and NetBeans validates documents according to doctype you can also fine-tune validation via menu Tools » Options » Editor » Hints » HTML. There turn off or change Show As of Elements. You will need to reopen html documents to apply new validation rules