markdown: HTML block level tags wrapped by <p> - perl

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.

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.

How to make textarea to show text with HTML properties in Ionic?

I have added a textarea on my home.html page. The problem is if I am adding data line wise by pressing enter, now when i save it in the database and show it back on page, it comes in one line
This is how I type:
1. Line one
2. Line two
3. Line three
This is how it is seen on the page:
1. Line one 2. Line two 3. Line three
Below is my HTML code:
<ion-textarea rows="1" autosize #input (click)="focusInput(input)" (input)="change()" id="messageInputBox" placeholder="Type Something To Send.." type="text" name="TAG" [(ngModel)]="TAG" style="z-index:9.99999; color:#818993;font-size:18px; ">
</ion-textarea>
How can I resolve this issue?
Where you echo the contents of your TAG model in your HTML template, you should use a pipe like nl2br-pipe and use it like this:
<div [innerHtml]="TAG | nl2br"></div>
Be aware that you also should sanitize your HTML, before echoing it to your page, more on that here.

How to insert a new Word style into a RMarkdown file

Is there a simple way to do this using Knitr without using Pandoc? I tried adding some HTML <DIV Class="newStyle>&nbsp</div> into an .Rmd file, but the style didn't show up in the generated Word .docx.
Thanks, Sue.
My setup: Office 365 Pro Plus, RStudio 1.0.143.
I was able to get both the <div> and <span> syntax to work. First I created a new style in my reference.docx document with the same name I intended to use in the Pandoc markup tags. Careful what you name the style -- this worked when I used the name "SpanAdd" but did not work with the name "Span_Add." The <div> tag should be used when you want to specify a paragraph style -- the default "Linked Paragraph and Character" style type in Word works fine for this. However, the <span> tag is more finicky and I was only able to get it to work with a "Character" style type. I based my character styles on "Default Paragraph Text."
Anyway, once I modified a new style in the reference document and saved it, I was able to use these tags within an .Rmd file to generate marked-up text.

How to highlight a text with double simple quotes '' in a HTML section

I'd like to highlight one or two words in a <HTML></HTML> section in a dokuwiki (2014-05-05 "Ponder Stibbons") page like I'd do outside of the section with ''one or two words'' or with apostrophe in SE markdown. How can I achieve that? Example (embedded HTML option has to be enabled in configuration):
====== Title ======
<HTML>
<ul>
<li>Magic should happen ''here'', except not with '' because it isn't recognized</li>
</ul>
</HTML>
The following doesn't suit my needs
<tt>one two</tt> simply doesn't look the same
Besides this I don't have any ideas...
Try enclosing the string in &quot tag like &quotkey&quot i.e. &quot tag appended with semicolon
May be misunderstood your question , now more clear
Try something like this if it helps by enclosing in code tags as shown in :
https://www.dokuwiki.org/faq:lists
Magic should happen 'here', expect not with because it isn't recognized
Also,check out the following link :
https://www.dokuwiki.org/wiki:syntax

how to paste <pre> into tinymce and preserve the formatting?

This seems very hard to do.
I'm pasting html code with <pre> into tinymce editor.
All the whitespaces are gone inside the <pre>
e.g. I'm trying to copy StackOverflow's <pre><code>block as in
def foo():
help me
It seems, tinymce trims whitespaces in <pre><code><span> and newlines are removed
How can I preserve it?
I'm using 3.5.3 btw
First of all you should set the entity encoding setting to raw
tinymce.init({
...
entity_encoding: "raw",
...´
But TinyMCE adds <br /> elements on line breaks if you edit your text. Here is a setup for syntay highlighting and preformatted text in NopCommerce, it is almost the same in WordPress or whatever.
TinyMCE Preformatted Text and Syntax Highlighting