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.
Related
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
Are there any methods to customize datepicker in Sulu via XML page config (e.g. I need to change date format)?
Sounds trivial, but http://docs.sulu.io/en/latest/reference/content-types/date.html says "No parameters available."
I am afraid to tell you that this is currently not possible... It would be nice if you create an issue on github also explaining the parameters you'd like to have.
And apart from that, the date format is based on the user language, so if the user has english as UI language he also gets the english formatted date. On the website you can use e.g. the date twig filter to format the date however you like.
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.
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.
I am currently stuck on what I feel like should be an easy solution, but I am not really getting anywhere with this. I am new to Eclipse RCP. I am trying to implement a view in which, all it does, is display a string, which has been formatted to XML. As in, my application does what it is meant to do, and when the user clicks Save, it saves all the info as an xml. I can get this xml as one long, unformatted string. I want a pane where the user can see (only see, not edit) the XML code that is going to be saved.
The reason I want a view is because this view is a multi-instance view, dependent on the perspective it is in. And I want it to display in XML format, with syntax highlighting. It would be nice for it to look like in an editor with line numbers and such, but with good formatting I am satisfied.
Does anyone know the best (any) way to implement this? Even some 3rd party widget is perfect for me.
Thanks!!
IIRC, the Plug-In editor example does basic syntax coloring and you can use the javax.transform packages to go from a stream to a DOM and back to a (formatted) stream.
just make your editor inherit from StructuredTextEditor (org.eclipse.wst.sse.ui.StructuredTextEditor.StructuredTextEditor)
For further details here:
FAQ How do I provide syntax coloring in an editor?
Platform Plug-in Developer Guide > Programmer's Guide > Editors