How to create a clickable hyperlink within a <pre> block in redmine textile? - redmine

I want to paste a block of code or output into a redmine note and reference my source as a clickable URL below it. In redmine's textile, the <pre> tag lets me post code. But I would like the URL reference of that code to be clickable and indented as much as the content above it.
However, the <pre> tag disables the rendering of URLs into clikable hyperlinks. Any way I can have a clickable hyperlink within a <pre> block in redmine's textile markup?

Prepend <notextile></notextile> to the first line of your <pre> block.
<pre>
<notextile></notextile>t.integer :status
-- http://stackoverflow.com/a/21185479/1611925
</pre>

Related

<pre> tag automatically added - HTMLCodeFormat() and HTMLEditFormat()

I have a form with several TinyMCE textareas. Content is loaded in some textareas when the form is called. Other textareas are empty.
The content that is preloaded into the text fields already has a <p> tag. Everything is fine with it. But i have a problem with the empty textareas. TinyMCE automatically adds a <pre> tag, which destroys the formatting and layout.
This is the process that leads to the problem:
Open the form and enter unformatted text to a empty textarea.
Save the form. The content is displayed correctly. Everything is fine so far.
Edit the form / content.
At this point, TinyMCE adds the pre tag. The tag is not yet saved in the database, it comes from the editor.
I also made some tests with preloaded content. This is the result.
Template code | TinyMCE textarea
<p>test</p> | <p>test</p>
test | <pre>test</pre>
How can I prevent TinyMCE from adding the <pre> tag? Alternatively, <pre> could also be replaced by <p>.
If you're on ColdFusion 10 or later, you should be using the OWASP ESAPI encoding functions. They handle a higher range of character encoding than HTMLEditFormat() and HTMLCodeFormat().
Output between HTML tags: <td>#encodeForHTML(variables.myVar)#</td>
Output in an HTML attribute: <input type="text" value="#encodeForHtmlAttribute(variables.myVar)#">
The cause of the problem was the use of HTMLCodeFormat instead of HTMLEditFormat before I handed the content over to TinyMCE. Both have nearly the same effect, but HTMLCodeFormat adds a <pre> tag in addition.
HTMLCodeFormat()
HTMLEditFormat()

Formatting html Django-cms

I create a app, where I can put html code like this
<h2>where we are?</h2>
<h4>Main Offices</h4>
My problem is when I show in my view I see the text with the html tags,
I try this {{ item|striptags }} but this remove the html tag from the page, even when I inspect the element it's look like string
"where we are? Main Offices"
What is the way in django-cms to don't see the html tag in the view, but when I inspect the element the tags is there!
Django automatically escapes the output of every variable tag, to protect you from Cross-site scripting. You can disable auto-escaping by using the safe template filter: {{ item|safe }}.

Binding HTML strings in Ember.JS

I am using a third party indexing service (Swiftype) to search through my database. The returned records contains a property called highlight. This simply adds <em> tags around matching strings.
I then bind this highlight property in Ember.JS Handlebars as such:
<p> Title: {{highlight.title}} </p>
Which results in the following output:
Title: Example <em>matching</em> text
The browse actually displays the <em> tags, instead of formatting them. I.e. Handlebars is not identifying the HTML tags, and simply printing them as a string.
Is there a way around this?
Thanks!
Handlebars by default escapes html, to prevent escaping, use triple brackets:
<p> Title: {{{highlight.title}}} </p>
See http://handlebarsjs.com/#html-escaping
Ember escapes html because it could be potentional bad code which can be executed. To avoid that use
Ember.Handlebars.SafeString("<em>MyString</em>");
Here are the docs
http://emberjs.com/guides/templates/writing-helpers/
if you've done that you could use {{hightlight.title}} like wished,...
HTH

WYSIWYG editor pastes html tags in output textfield

I use this redactor for admin site django-wysiwyg-redactor
But when I enter some text, it pastes it with html tags. When discovering my source code, I noticed that html code that is responsible for my input data, is placed in quotes.
I think you have to use "safe", the built-in template filter to render the html properly in your template. Example:
{{ myTextField|safe }}
Safe in django docs

laravel blade template engine content displayed outside end html tag

I am very new to laravel frame work, I am using laravel 4.2, now i have a problem with my blade template engine.
In my laravel admin panel After user login one dashboard page will display. This page is working fine.This page consists of master.header.php (which is my header) and dashboard page which is my left menu.
Blade code as follows
<pre>
below is my dashboard page code
#extends('includes.header')
#section('head')
#parent
<title>DashBoard</title>
#stop
#section('content')
LEFT MENU COMES HERE
#stop
</pre>
<pre>Now in my left menu different links are there.
So i want to inlcude header.blade.php and dashboard.blade.php in each link page.
Left menu page code as follows
<pre>
page name is : Employee.blade.php
#extends('usercp.dashboard')
#section('head')
#stop
#section('content')
hi this is my one of left menu section
</pre>
**OUT PUT**
<pre>
But when i click on the left menu link the content is displaying (hi this is my one of left menu section) at the header.
When i see the source of Employee.blade.php the left menu is out side </html> tag.
Not in body tag.
Can any one please help me in this regard.
</pre>
A few thoughts on your code:
In your left menu page the #section('content') is not closed, add a
#stop
The #extends command has to be the first line in your blade
template, with no html/whitespaces before it.
If you want to include another blade template (e.g. your header), use
#include('partials.header'). By extending another template you can
override the sections of your parent template, which is not
what you want for your header, I'd guess.