lovepong
lovepong

Reputation: 625

How to convert string(WYSIWYG) to raw html by using JavaScript Lib?

I'm using http://www.appelsiini.net/projects/jeditable (jEditable JS Lib) in my Rails app's project and i found problems then trying to use about "Usage with Textile, Markdown". The problems is i could't use .php file into Rails project. Any solution for solving this case?

=> For more understanding what i what

How to convert string(WYSIWYG) with new line become to raw html?

Example :

one
two
three
four

Output :

one<br>
two<br>
three<br>
four<br>

Is any JavaScript library to solve this? Thanks,

Upvotes: 2

Views: 1091

Answers (1)

p1100i
p1100i

Reputation: 3740

If I understand correctly your problem is, that after you store dynamically uploaded html code, rails sends you that back as escaped data. You can use the raw method to display some source ( with you trust in 100% ).

<%= raw some_variable %>

Upvotes: 2

Related Questions