Org-mode: protect emphasis - emacs

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?

Related

WebStorm is adding unwanted line breaks in <p> tag

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.

Append space to <li> content

I'm using algolia to display search results, and it strips all tags for my product descriptions.
This means that:
<ul>
<li>Feature One</li>
<li>Feature Two</li>
<li>Feature Three</li>
</ul>
displays as
Feature OneFeature TwoFeature Three
Unfortunately I'm not able to change how these tags are stripped.
My question: Can I tell Redactor to format an <li> with a space at the end, so
<ul>
<li>Feature One </li>
<li>Feature Two </li>
<li>Feature Three </li>
</ul>
Will be rendered as
Feature One Feature Two Feature Three
Any help would be appreciated
It sounds like you are saying Redactor strips out html tags. Will it permit you to add HTML character entities?
For example, could you try to add a non-breaking space ( ) to your data to add your desired space:
<ul>
<li>Feature One </li>
<li>Feature Two </li>
<li>Feature Three </li>
</ul>

Delete Closing Tags with line in notepad++ (HTML)

If in notepad++ I want to delete a line which has a < div> tag on it, is there a way to automatically delete the closing line containing < /div> without deleting the lines inbetween?
So in this example to delete lines 1 and 18 whilst retaining lines 2 to 17
image of code at: http://i.imgur.com/UdllZqY.png
This solution is a little bit convoluted bit it can be done purely in notepad++
Make sure you have the HTML Tag plugin installed. This can be done by going into Plugins > Plugin Manager > Show Plugin Manager, selecting the plugin named HTML Tag and installing it (if you haven't already). Or install it manually by downloading it from here
Have your text cursor over the start or end tag of the tags you want to remove and press CTRL+SHIFT+T. This will select the entire element and all of its children
Press CTRL+H to bring up the find and replace window.
->Select Regular expression mode,
->make sure 'In Selection' is checked,
->use the expression (?s)\A<[^>]*>(.*?)<[^>]*>\Z in the 'find what' text box
->and the replacement \1 in the 'replace with' text box.
Now press the replace all button to remove the first and last tag.
Repeat steps 2 to 4 for any other replacements of this kind.
Using this method the example:
<div class="col-md-4 sidebar">
<div class="panel panel-default">
<div class="panel-heading">
News Feed
</div>
<div class="panel-body">
Past Posts
</div>
</div>
<p class="lead">News feed</p>
<ul>
<li>post 5</li>
<li>post 4</li>
<li>post 3</li>
<li>post 2</li>
<li>post 1</li>
</ul>
</div>
Becomes:
<div class="panel panel-default">
<div class="panel-heading">
News Feed
</div>
<div class="panel-body">
Past Posts
</div>
</div>
<p class="lead">News feed</p>
<ul>
<li>post 5</li>
<li>post 4</li>
<li>post 3</li>
<li>post 2</li>
<li>post 1</li>
</ul>
Nothing I know of will do this in notepad++.
You can't select multiple ranges of text, only a single continuous block of text. Unfortunately to delete text you have to select it and as there is no multiple range selection there is no way to perform the desired deletion.
There are plugins that can find the matching tag and changing language to HTML will also highlight the matching tag. This will let you easily see the location of the matching tag, but you will still have to select and delete the matching tag manually.

Is there a way to begin GFM ordered lists at 0?

Is it possible to have an ordered list in Github Flavored Markdown that begins with '0'?
Just typing 0. at the beginning is getting rendered as '1.'
Considered GitHub Flavored Markdown (GFM) is markdown plus a few features, the answer would be the same as for "Begin ordered list from 0 in Markdown":
If you want to start at certain number, unfortunately, you have to use pure HTML and write:
<ol start="0">
<li>Item 0</li>
<li>Item 1</li>
<li>Item 2</li>
</ol>

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.