Append space to <li> content - algolia

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>

Related

Why Prettier adds These Weird Strings in React Code

I am facing this issue a lot nowadays. After I save the file in my react project, I see these {" "} weird strings at the end of almost every line.
For example, this was my code.
<ul>
<li> <span>npm start </span> : to start the project </li>
<li> <span>npm build </span> : to build the project </li>
</ul>
After I saved the file prettier converted it to
<ul>
<li>
{" "}
<span>npm start </span> : to start the project{" "}
</li>
<li>
{" "}
<span>npm build </span> : to build the project{" "}
</li>
</ul>
and added {" "}. Is there any configuration to get rid of this issue?

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>

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.

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?