WebStorm is adding unwanted line breaks in <p> tag - ejs

I have this code in an .ejs file, writing the second block on the web page:
<h1>
written by "<span class='accent'><%= params.user %></span>"
</h1>
written by "Salmon"
However, when I'm reformatting my code in WebStorm (Ctrl+Alt+L) it will change it to this, resulting in unwanted spaces before and after the quotation marks:
<h1>
written by "
<span class='accent'><%= params.user %></span>
"
</h1>
written by " Salmon "
I've tried going through the HTML & EJS code style pages in WebStorm, removing h1 from the lists it appears in to no avail. Besides those changes that I later rolled back I am using default settings.

Related

What setting is causing VS Code to mess up code formatting when I paste?

I am working on vue file, but same problem happens when in javascript language mode.
When I paste in the following text,
<li><a
:class="{'toggle':true, 'layerOn':dispHandicappedParking}"
href="#"
#click.prevent="dispHandicappedParking =! dispHandicappedParking"
>Accessible Parking</a>
</li>
VS Code immediately autoformats it to the following:
< li > <a
: class="{'toggle':true, 'layerOn':dispHandicappedParking}"
href = "#"
#click.prevent="dispHandicappedParking =! dispHandicappedParking"
> Accessible Parking < /a>
< /li>
If I then hit "undo", the bad formatting is removed, but the pasted code stays (which in itself seems a strange behavior: I'd expect paste to be a one-step-undoable action).
What setting to I need to adjust in order to stop the editor from mangling my code?
Ok, was an extension: Vue Language Features. I guess that's what I get for installing a preview build and forgetting about it!

netbeans macros - quote completion

I have this netbeans macro, that simply outputs some html :
"<div class=\"kbox\">"insert-break
" <div class=\"title\"></div>"insert-break
" <div class=\"hide\">"insert-break
" </div>"insert-break
"</div>"insert-break
The problem is that when I fire the macro, I get :
<div class=""kbox>
<div class=""title toggle_div"></div>
<div class=""hide">
</div>
</div>
The quotes autocompletion fires on the macro output and the css class names end up outside their quotes... Is there a way to stop this behaviour for macros? I don't want to turn off autocompletion...
Using Netbeans 7.4
Put delete-previous after the double quotes.
In my code it looks like this:
"[<span class=\"" delete-previous
So you put one quote mark netbeans automaticaly adds second and then you delete it.

markdown: HTML block level tags wrapped by <p>

I'm using markdown.pl downloaded from directly from Darring Fireball to translate .md files into html.
I start the file with some block level html, then followed by markdown syntax
<div class="header">title</div>
# header
markdown keeps wrap the <div> class with <p> tags, producing:
<p><div class="header">title</div></p>
<h1>header</h1>
If I start the file with a newline, before the html block level tag, an empty will be produced
<p></p>
<div class="header">title</div>
<h1>header</h1>
I want to know how to stop markdown from wrapping my block-level HTML tags with <p>s.
That code is not maintained because Gruber don't care. ¹ ²
Use Text-Markdown Markdown.pl instead, it works like you expect it to.

How to prevent Eclipse from indenting textarea's content on Ctrl+Shift+F?

I'm using Eclipse (Juno). I have a form on a JSP page that has a textarea as follows:
<textarea name="t"><c:out value="${val}" /></textarea>
When I format the code (ctrl shift F) it becomes:
<textarea name="t">
<c:out value="${val}" />
</textarea>
Which is fine except that it inserts extra spaces and lines in the text area. I like formatting my code using Eclipse, but the spaces/lines get added to the database when the form is submitted. Even worse, it gets compounded every time that form is submitted again. What am I doing wrong?
Try adding "textarea" to the list of inline elements on the Web->HTML Files->Editor preference page.

Org-mode: protect emphasis

How could I protect emphasis like italics or code within Emacs org-mode
when I have things like
/cologne/dome/
or
=<pre language="python">=
?
The following org-block demonstrates which parts work by default and which need a small amount of work-around to work.
The following was created using Org-mode version 7.8.03 (release_7.8.03.321.gaac1c). If you're using an older version it is possible that the behaviour is slightly different.
See Literal Examples and Monospace in the Org-Manual for full details
ORG
* Italics
- Your example simply works\\
/cologne/dome/
- It also works if your /example had / spaces within it/
- It will only fail if / your /have spaces on one end or the other /
* Code
Code blocks can be delimited in multiple ways:
** Inline formatting
- Using ~ for verbatim text works\\
~<pre language="python">~
- ~ renders the same as = for blocks =test= ~test~
** Code Blocks
- Single-line blocks
: <pre language="python">
- Multi-line blocks
#+BEGIN_EXAMPLE
asdf
#+END_EXAMPLE
HTML Export
<div id="outline-container-1" class="outline-2">
<h2 id="sec-1"><span class="section-number-2">1</span> Italics</h2>
<div class="outline-text-2" id="text-1">
<ul>
<li>Your example simply works<br/>
<i>cologne/dome</i>
</li>
<li>It also works if your <i>example had / spaces within it</i>
</li>
<li>It will only fail if / your /have spaces on one end or the other /
</li>
</ul>
</div>
</div>
<div id="outline-container-2" class="outline-2">
<h2 id="sec-2"><span class="section-number-2">2</span> Code</h2>
<div class="outline-text-2" id="text-2">
<p>Code blocks can be delimited in multiple ways:
</p>
</div>
<div id="outline-container-2-1" class="outline-3">
<h3 id="sec-2-1"><span class="section-number-3">2.1</span> Inline formatting</h3>
<div class="outline-text-3" id="text-2-1">
<ul>
<li>Using ~ for verbatim text works<br/>
<code><pre language="python"></code>
</li>
<li>~ renders the same as = for blocks <code>test</code> <code>test</code>
</li>
</ul>
</div>
</div>
<div id="outline-container-2-2" class="outline-3">
<h3 id="sec-2-2"><span class="section-number-3">2.2</span> Code Blocks</h3>
<div class="outline-text-3" id="text-2-2">
<ul>
<li>Single-line blocks
<pre class="example">
<pre language="python">
</pre>
</li>
<li>Multi-line blocks
<pre class="example">asdf
</pre>
</li>
</ul>
LaTeX Export
\section{Italics}
\label{sec-1}
\begin{itemize}
\item Your example simply works\\
\emph{cologne/dome}
\item It also works if your \emph{example had / spaces within it}
\item It will only fail if / your /have spaces on one end or the other /
\end{itemize}
\section{Code}
\label{sec-2}
Code blocks can be delimited in multiple ways:
\subsection{Inline formatting}
\label{sec-2-1}
\begin{itemize}
\item Using \~{} for verbatim text works\\
\verb~<pre language="python">~
\item \~{} renders the same as = for blocks \texttt{test} \verb~test~
\end{itemize}
\subsection{Code Blocks}
\label{sec-2-2}
\begin{itemize}
\item Single-line blocks
\begin{verbatim}
<pre language="python">
\end{verbatim}
\item Multi-line blocks
\begin{verbatim}
asdf
\end{verbatim}
\end{itemize}
I guess you want to output the original /cologne/dome/, but not <i>cologne/dome</i>, right?
Two ways:
set #+OPTIONS: *:nil to turn off all emphasis symbols
modify org-emphasis-alist, remove the relevant items
I also asked a similar question here: How do I escape slash in org-mode?