How to convert string(WYSIWYG) to raw html by using JavaScript Lib?
-
30-06-2021 - |
문제
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
- http://www.textism.com/tools/textile/
- http://www.appelsiini.net/projects/jeditable/default.html (On 'Textile renderer' and try to type in field and press enter or write html tag such as < h r > or < b > or etc,. and then submit you will see like (WYSIWYG).
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,
해결책
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 %>
제휴하지 않습니다 StackOverflow