Emit raw html in ASP page? - html

This is extremely aggravating. I just want to simply insert raw html. I can't use the literal control because there's no ignoring the quote character. I don't want to use a script element because I'm adding it in a ascx file. I just want raw html output. Is there no operater for this?

I've properbly misunderstood you completely but:
In Classic ASP it is:
<%=("<div style=""color:red;"">html</div>")%>
output:
<div style="color:red;">html</div>

Related

html to jade error when contains <pre>

I have some static html documents, and I want to convert them into Jade. I tried html2jade in npm, everything is OK except this: the <pre> elements in html convert empty, can someone help me?
The html code looks like this:
<pre><code><p>Hello</p><span>Hello Again</span></code></pre>
The result is:
pre.
You can write that a couple different ways in Jade. Here are two different methods. The first takes advantage of Jade's automatic escaping while the second uses HTML entities instead.
Automatic escaping:
pre
code= '<p>Hello</p><span>Hello Again</span>'
HTML entities:
pre
code <p>Hello</p><span>Hello Again</span>

tinymce : how to convert raw html tags?

i used tinymce to allow people to write content. But now i wan't them to edit their own content, i need to use tinymce again.
My problem is in my database, this content is composed of html tags, and when i try to load the text in my tinymce textarea (in edit view), i've got the raw content eg <p> Hello my name is <em>John</em> [...] </p> . But when they written this content, it was with "wysiwyg".
I want to convert this raw html to wysiwig.
here a screenshot of the raw html
and i want it to be like this when they click on "edit my content" button :
I use this:
echo <textarea name="icerik" id="editor1" rows="10" cols="80">'.htmlentities($satir->icerik).'</textarea>;
I use "htmlentities" method in php to convert html code to wysiwyg. When you write that converted text between and , you can get what you want.
Assuming you're using PHP of course. If not, try to search like for example "htmlentities in asp.net" or wait for another answers.
tinyMCE.activeEditor.setContent('<span>html data from your database</span>');
Use this:
strip_tags(stripslashes('row html content'))

Trying to convert plain textarea input into somewhat formatted newlines

Here's an example of what I'm inputting into my creation form:
I'd like to somehow convert that input into actual HTML when rendering in my view like:
<p>+65 Magical Power</p>
<p>+75 Mana</p>
<p>+10 MP5</p>
I tried to create a helper method in the Item class. But it seems I cannot use the content_tag method in the Models or Controllers.
What would be a good way to solve this problem?
I think <xmp></xmp> can be used. I tried using it with simple <p> </p> tag but did not try echoing the input field.

Is it possible to encase an invalid HTML snippet in a HTML document such that the snippet does not affect the page?

I am trying to display chunks of HTML from a DB, and sometimes it is a portion of the entire HTML page, so may be invalid, since I may be returning the first 500 chars. I may get:
<h1>test</h1><div id="
At present this corrupts the containing page.
Can this be wrapped up in someway, by some tags, such that it does not corrupt the containing HTML.
My initial idea was something like:
<div>
<h1>test</h1><div id="
</div>
However this does not work.
Also it would be ideal if any valid HTML did work as expected, so the above would look like:
Test
It may not be possible, but I thought I would ask.
I am not aware of what Server Side/Client Side language you are using, but I assume you are using PHP, you need to use strip_tags() to strip all the HTML text first, and than try echoing it..
<p class="static_wrapper">
<?php echo substr(strip_tags($fetched_row['column_name']),0,100).'...'; ?>
</p>

Rails 3 Escape BBCode-parsed HTML Only Within Pre+Code Tags

I'm trying to implement a markup system in my Rails application using the bb-ruby gem. Currently I'm working on something similar to how Stackoverflow handles it's code markdown and I ran into some difficulty.
Essentially I want the user-entered text:
[code]<h1>Headline</h1>[/code]
To spit out the code in plain-text, perhaps in a pre and code tag block. Passing that string of text to my code parser will wrap the code in a pre and code block but the HTML also gets rendered. I pass the string to my code parser like so:
sanitize(text.bbcode_to_html(formats, false).html_safe)
Of course, if I remove the .html_safe helper from the call my view will spit out:
<pre><code><br /> <h1>Hello World</h1><br /> </code></pre>
Obviously that's not the desired result. So my question is, how can I accomplish plain-text code only within the pre + code tags while maintaining the html_safe helper method?
I know this is an old question but you can try using the strip_tags after the bbcode_to_html one.