How to change number base and direction with emmet - visual-studio-code

In regards to an official document on emmet usage for changing number direction, the following should work in numbering values in reverse order:
ul>li.item$#-*5
But...that does not work in Visual Studio Code version 1.43.2
What is the proper emmet syntax for listing out the following numbers like so...
<ul>
<li class="item5"></li>
<li class="item4"></li>
<li class="item3"></li>
<li class="item2"></li>
<li class="item1"></li>
</ul>

Looks like the ability to count down will be added to v1.53, see pre-release notes https://github.com/microsoft/vscode-docs/blob/vnext/release-notes/v1_53.md#emmet-performance-and-feature-improvements
Emmet now works much faster in large HTML and CSS files. Also, the
extension now uses the latest Emmet dependency, meaning that features
such as countdowns are now supported.
It looks like you had the proper syntax.
------ previously ::
It doesn't work in vscode. See https://github.com/microsoft/vscode/issues/87657 and https://github.com/microsoft/vscode/issues/69168 and https://github.com/microsoft/vscode/issues/35296.
It is on the Backlog but deosn't appear to being actively addressed. Vote up the issues.

Related

Wagtail. Ability to edit html within editor

My editors want to have an ability to edit raw html within editor.
For example, we can have simple list markup:
<ul>
<li>Some text<li>
</ul>
Or with custom classes and event tags:
<ul>
<li class="my_class">Some text
<span class="special">Some additional info</span>
<li>
</ul>
And so on.
I know that built-in Draftail doesnt support html editing.
But using third-party editor comes with problem:
Losing integration with system. For example, i cant just put image like with draftail. Or, preview mode cant handle all functionality of third-party editor.
So, maybe someone has working solution for this situation.
I thought about using special StreamField panels, but it seems to be overhead of blocks. Dont like this idea of having lots of blocks with little differences
Wagtail does not support raw HTML editing within the page editor out of the box intentionally. The philosophy (zen) of Wagtail is to help editors and developers 'wear the right hat' when working in Wagtail.
HTML editing is usually best provided to developers, where there is an expected knowledge of what is required for things like accessibility, security and the benefit of tooling (like git).
However, if HTML editing is a must, you will probably need to build your own editor field for that purpose or find a suitable package that works with HTML markup such as django-markupfield. Adding image/snippet/page chooser functionality however will have to be built for whatever you end up using. You may also want to look at the Wagtail markdown package either as an alternative to HTML or a starting point, it allows for a syntax of linking to pages/images.
Wagtail lets you use any kind of Django field or widget with the FieldPanel.
Please ensure you consider all the risks when implementing this feature, such as accessible HTML (e.g. heading levels), security (disallow some tags such as script tags), malformed HTML leaking into the rendered template and of course the end user experience.
At the end i made my own solution
Simple rewrite some methods in wagtail`s Html DbWhiteLister and HtmlConverter.
This gives me an opportunity to allow any tags with any attributes.
https://github.com/Chenger1/wagtailtinymce.-Full-Rich-Text-Editor

Handlebars formatting in NetBeans

I'm using NetBeans as my IDE for a Ember.js project. When I create handlebars templates in my app like below the code highlighting doesn't work correctly.
<script type="text/x-handlebars">
<div>
</div>
</script>
Normally, when I'd select the first div, it and its matching end tag would highlight yellow, but this doesn't work. Since its inside the handlebars script tag both are highlighted red as errors and don't match together. This makes writing complex templates kinda annoying as it can be difficult to pinpoint syntax errors.
Is there anyway to get NetBeans to highlight inside the handlebars tag as if its regular html?
One option, until Netbeans implements this enhancement, is to add the following script tag in index.html immediately after your reference to jQuery:
<script src="js/libs/jquery.js"></script>
<!-- use following line to change script type to 'text/x-handlebars' -->
<script>jQuery('script[type="text/html"]').attr('type', 'text/x-handlebars');</script>
This is a variation of the answer provided by GCoda.
I had the same problem and tried various non satisfying fixes.
In the end I figured the best solution is simply to change the script's type attribute to text/html:
<script type="text/html">
<div>
</div>
</script>
I got same problem. And i just used a some kind of postprocessing, i am using node.js, so i did res.send(data.replace(/type="text\/html"/g,'type="text/x-handlebars"')); on my / page.
I think you can do something similar in you language, and ofcource this is not a fix, just an ugly trick to make developing more easy. Dont keep it in production.

HTML comment tag <!-- --> Removed in CQ5

I'm using Rich Text Editor with MiscTools plugin to edit text in CQ%
However when I open the HTML editor and create sth like this
<div id="test">Test <!-- Test Comment --></div>
the CQ rewrites it to after switch back to HTML mode and source edit mode
<div id="test">Test </div>
Is it possible to keep HTML comment tag <!-- --> in the source code?
Thank you for answer my question
I would suggest taking it out of the div and see if that works.
In CQ5.4-5.6.1 (not sure about latest version AEM6), the Rich Text Editor intentionally strips out all HTML comments. The only way to stop it from doing this is to modify the product javascript source code in WhitespaceProcessor.js. However, allowing HTML comments in this way wouldn't be recommended as it hasn't been fully tested it might cause other errors. If you still need this feature, then you might consider contacting Adobe Customer Care to request it to be officially added to the product.

I want to make a accordion, and I want it to function like a site I found

It has to be able to run in Wordpress, and it also has to be able to house as many "sections" as I wish. It also has to be able to have multiple instances of the accordion with different information in each. The site that I got the idea from was http://www.steppenwolf.org/Plays-Events/.
I have next to no experience with javascript, but am proficient with HTML and CSS.
I am NOT asking you to make this for me, only help me in the building of such a thing.
I want to be able to use an unordered list to form the accordion:
<ul class="accordion-1">
<li class="accordion-item-1"></li>
<li class="accordion-item-2"></li>
<li class="accordion-item-3"></li>
<li class="accordion-item-4"></li>
</ul>
<ul class="accordion-2">
<li class="accordion-item-5"></li>
etc...
I would advise looking to see if there is already a plugin available. I did a quick search and found a jQueryUI one - http://wordpress.org/extend/plugins/jquery-ui-widgets/
This will allow you to use the Accordian plugin

encoding problems on site.master page (asp.net mvc2) on production server (2003 with IIS 6)

I have a site that uses the Hebrew language.
All the pages looks great, expect from the text that is generated in site.master.
This text comes a gibberish.
This is from master page:
<ul id="menu">
<li>
<%: Html.ActionLink("לקוחות", "List", "Customers")%></li>
same code from any other page shows hebrew chars.
The result is either gibberish, or encoded gibberish:
<div id="title">
<h1>
îòøëú ðéäåì ùéáåõ èëðàéí</h1>
</div>
<div id="menucontainer">
<ul id="menu">
<li>
ì÷åçåú</li>
tried to switch encoding in the browser but nothing gets me back to Hebrew.
This happens ONLY on production server, on my Dev machine (win7) it works fine.
The views inside the master pages shows OK also on production.
Any ideas ?
My advice would be: ditch the IIS 6 and use IIS Express, which you can install on most old OS's. It does introduce another technology into the question but this technology is newer, easy to use, maintain and script and more suitable for this new range of web development technologies like MVC, etc.
So, if you have an option to select what you use and can make decisions about it, definitely go for it.
Alternatively, you can play around with server regional settings and stuff like that but you might end up losing lots of hours to this.