VS 2010 Markup Formatting For Comments - visual-studio-2010

How to format
...
</div>
<%--Parent Category--%>
<div class="field">
...
to
...
</div>
<%--Parent Category--%>
<div class="field">
...
I could not find a way to do that using Tag Specific Options in Tools-->Options. Any suggestions would be appreciated. Thanks.

You almost had it:
Go to the Tag Specific Options, add a new Tag to the Client HTML Tags.
The name of the tag should be %--
Closing tag: No Closing Tag
Link breaks: 2 Before opening, within, and 2 after closing
This will format it the way you want, and it will not touch the <%: and <%= directives, for which you also could define formatting by adding tag for them and calling them %= and %:

Related

Typo3 close and start a new paragraph <p> in each <br /> in bodytext at news extension

I'm using Typo3 9.5.14 and CkEditor to add and edit news articles, i see in frontend that it is closing and starting a new paragraph at every in the bodytext area here an example :
<p>
Text somthing <br />
Text somthing 2 <br />
Text somthing 3 <br />
Text somthing 4 <br />
</p>
After save, i see in frontend is converted to this;
<p>Text somthing </p>
<p>Text somthing 2 </p>
<p>Text somthing 3 </p>
<p>Text somthing 4 </p>
But in source it is still in the original code even after save.
Is it really because CKEditor and how can i prevent this ?
This is causing the problem of adding new spaces between each line of text.
Possibly switch to direct source editing?
The other reason could be you need to allow tags in the editor configuration. Like this :
TYPO3 9.5.4 CKEditor RTE deletes style attributes
Hope it helps you
EDIT:
Does this setting still work in TYPO3 9? maybe that is it:
https://docs.typo3.org/m/typo3/reference-coreapi/7.6/en-us/Rte/Transformations/Tsconfig/Index.html#dontconvbrtoparagraph
I come back with the solution i find, i have uninstalled the obsolete extension rtehtmlarea, and this solved the problem.

Laravel 5.2 + Unicode

when I use a single view file with uni-code in it, it shows the the content correctly but when I make a layout and extends with it from another page it doesn't show the uni-code character it shows ????
#extends('layouts/custom_layout.blade')
Check what encoding is used in your other view. Convert it to UTF-8 and it will work fine.
To avoid encoding related problems, use popular IDEs or text editors like Sublime Text or Notepad++ for editing files.
In custom_layout.blade.php file:
````
<div class="container">
<div class="content">
<div class="title">Laravel 5</div>
गृह
</div>
</div>
````
In home.blade.php file:
#extends('custom_layout')
And off course I have used meta tag charset="utf-8" in head tag.
My friend I had the same problem with the unicode characters it turns out that the IDE was causing the problem , I use Jetbrains PHPStorm. I edited the file with sublime and it turns alright.

How to add JavaScript highlighting inside of Underscore.js templates in Atom

I'm wondering if there is a way to add syntax highlighting for JavaScript code inside of Underscore.js templates in Atom editor? I've searched for some plugins for that, but with no result.
I have a number of HTML files with Underscore.js templates inside of HTML, and the code looks like this:
<div>
<% lists.forEach(list => { %>
<span id="list-<%= list.id %>"><%= list.name %></span>
<% }); %>
</div>
So maybe there are some plugins that I've missed? Thanks in advance.
Try changing grammar to Html (Ruby - ERB). Edit -> Select Grammar

Magento main content blocks. Removing wrapping <p> tags

I'm doing maintenance work on a magento site for a client and I'm trying to w3c validate the site.
The problem is that the blocks in the main column are all being wrapped with a <p> tag.
<div class="col-main last">
<div class="std">
<p>
<div class="flexslider">
...
I tried using debug_backtrace and managed to locate the problem to originate somewhere between calls to the Abstract class (app/code/core/Mage/Core/Block/Abstract.php). Maybe there is some sort of filter that applies the <p> tag?
I've not previously worked with magento so any help towards debugging the issue would be greatly appreciated.
Where should I start looking?
If it's only for cms pages then the <p> comes from the content of the page. Edit the page in CMS->Pages and replace the tag with a <div>.

MVC wrap content with static content. UserControls?

I'm trying to wrap content with some static HTML in MVC and I'm not having any luck figuring this out. There must be an obvious solution that I'm not seeing, as this would seem like a desired feature.
In my View, I need to wrap HTML content with something:
<uc1:mc>
<p>Hello World!</p>
</uc1:mc>
That will render like:
<div class="ribbon">
<div class="left"></div>
<p>Hello World!</p>
<div class="right"></div>
</div>
With a Template like:
<div class="ribbon">
<div class="left"></div>
<%= IncomingMarkupGoesHere %>
<div class="right"></div>
</div>
The idea is to reuse html that wraps around other html.
I'm currently using two User Controls to achieve this, one with everything before and the other with everything after. Something like this:
<% Html.RenderPartial("RightRibbon_Start"); %>
Target Content...
<% Html.RenderPartial("RightRibbon_End"); %>
But this seems sloppy and isn't conducive to passing parameters that apply to HTML before and after the target content.
It's important that the content to be wrapped be allow to be written as multiple lined markup and not just a string, otherwise I would just pass the content as the Model.
What about creating helpers and passing the HTML in as an argument?
Passing html markup into an ASP.NET User Control

Resources