TinyMCE Printing HTML - asp.net-mvc

TinyMCE...
when I save form data, the text that was entered through the editor is being displayed with all of the tags in my index and detail view. Any idea how I can display the data as normal without html mark up?

How are you outputting the text ?
I'd guess you should be using this:
#Html.Raw(Model.MceText)

Related

How to display localized text rendered from javascript in a razor cshtml view

We display a tooltip on mouse enter that gives a hint about the field over which they hover. We would like to localize that text. All other localized text in the view is localized using resource bundles and are loaded using something like #Localizer"My text"). But on mouse enter the text is rendered by the js. SO how does one localize that in a razor view.

how to show html content for md-selected-item in md-autocomplete

We are trying to use md-autocomplete in our application. Things are working as expected, but we have a specific requirement for displaying the selected item.
Instead of just displaying a text, we need to display a HTML content with some avatar and formatted content.
md-item-text only displays any text provided, I tried the html content, but it does not work.
md-item-template works for the items displayed in the list, but the same styling is not applied to selected item.
Is there anyway to show the html content in Selected Item ? Any suggestions ?

Display text fetched from html page in UILabel

I'm parsing a HTML page in Swift and I got a list of titles. However, the titles couldn't be displayed properly in a UILabel. I've parsed other pages and all of them is OK to show, except this page. Following are some of titles:
Vô trÆ°á»ng công tá»­
Vô tự thần bi
Vô ưu kiếm
Vong má»nh thiên nhai
I'm not sure what kind of encoding the page uses for its text, but all the titles display well in my browser. Can you help me fix this?

Print pages from a .gsp page

I have a .gsp file where I have 2 forms containing a button for print. I need to print out a page using the information using 2nd form content when print button is pressed.
How can I do this?
On click of the print button, you can populate a hidden div with the form information. Then using a CSS print stylesheet (using media queries), you can format that div to print the information as you see fit.
If you are looking to popup the print dialog on click, then use window.print() in your javascript code.

How do I allow Multi-line content in a rails text_area field?

How would I go about allowing users to input multi-line text in a text_area form field?
Currently anytime content is entered in the text areathe line breaks are removed... They are retained when I edit the content... So, maybe it's in the show view that the breaks are being removed?
I've found a few things that indicate that I'd need to implement a WYSIWYG editor, but I'd prefer to avoid that if possible.
Any suggestions?
UPDATE: So, it looks like rails saves the content with line breaks, and I can add .html_safe to the field in the show view (i.e. <%= #post.post.html_safe %>). Now it will present content with basic html (e.g. <br>, <b>, etc...) but still doesn't present the line breaks in the content (i.e. when I press enter for a new line) that are saved by rails and I can view when I'm editing the content.
Linebreaks are not rendered in HTML. You will want to use something like simple_format or wraptext on your content as you echo it out to convert newlines to <br> or <p> tags.
<%=simple_format(#post.post).html_safe %>
or
<%=Wraptext::Parser.new(#post.post).to_html.html_safe %>

Resources