Rich text editor replaces characters with html - html

Oracle apex version: 20.1
I have a form in which the user can copy and paste email chains into a rich text editor form field. The form field is based off a column in my table that is stored as a CLOB. As you can see here: Form Field Displaying Email the rich text editor does an amazing job at preserving the characters, indentations, and the image as well.
The problem is we save hundreds of these emails, so when we have to provide information to an outside source we have to include all of these emails. We obviously don't want to have to click into each one of these records and copy/paste the email into a file and send them one by one. So I created a report that can display all of them at once, then use a print feature to save the report as a PDf. The description column is of type: Remove HTML. Report Displaying Email (This is the same email but I also pasted the reply to the email on top)
As you can see it has problems when it runs into certain characters. Almost all apostrophes are replaced with either ’ or '. Bullets are replaced with • and greater/less than signs are replaced with >. My character test line of !##$%^&*(){}><?/ displays as !##$%^&*(){}><?/
Is there a better way to format all of these emails so they can be downloaded into one file (pdf)? How can I tell apex to leave all of those characters alone while still removing the html?

Related

Email URL reverts to text on refresh of webpage

I have a Domino form that has a computed RTF that pulls text from a field using an #DbLookup. The text contains an email address enclosed in <a </a> brackets. When the page loads, the email address appears as expected. When a user clicks a search button that runs an agent to refresh a subsequent field, it replaces the email address with the exact text including the <a </a>.
The text (marked as Pass-Thru HTML in the field) is:
Below are the groups that you have authority to administer. Please select one. If you have other groups that you would like to administer online, please email EmailAddress#Organization.org.
The code in the RTF to pull it is:
#DbLookup("Notes":"NoCache";#DbName;"vwContentForms";"OtherReporting";#ThisName)
When the page first loads, it displays properly.
Below are the groups that you have authority to administer. Please select one. If you have other groups that you would like to administer online, please email EMailAddress#Organization.org. with the email address marked as a link.
After pressing a search button on the form that refreshes the page, it replaces the text email EMailAddress#Organization.org with email EmailAddress#Organization.org.
What am I missing or doing wrong?
Midway down in the documentation for #DbLookup, it says
When you use a fieldName to perform a lookup, the value returned is the value that is actually stored in the field; it may be different from what displays in the view. Domino® can retrieve data from any field in any document displayed in the specified view, but if the field isn't displayed as a view column, Domino® must search the entire document to find the field, which may result in a slower lookup. You cannot retrieve data from a rich text field using #DbLookup.
This might mean "It kind of works sometimes, in some situations, but sometimes doesn't and we're not intending to fix it."

Saving text as HTML from form

I have a form with a text field that users input text into. They can use multiple lines, put in bold text, underlined text, etc., but the text, when saved to SQL Server doesn't have any formatting saved, just the text is saved. What is the best way to save the text with the HTML so that when it gets viewed by another user and pulled up from Sql Server the HTML is saved and the formatting is saved?
Ex.
hello
Paul
This would be saved as
helloPaul
you can't see it but there are bold and carriage return html tags rapped around the text
When receiving data from the user, on the server side code, use HTML encode to safely store the data:
var inputData = Server.HtmlEncode("<strong>some data input from user</strong>"); //insert your user input data variable here
Then when displaying the data in your cshtml page, decode the data to display it as the user entered it:
HttpUtility.HtmlDecode(saveUserDataFromDatabaseVariable);
All this is assuming you have a rich text editor being plugged into the input field. CKEditor and TinyMCE are good ones.
You can use a text editor. Take a look at CKEditor. It's free and easy to use :)
Can you post some code and more details?
I have had good success with CKEditor. It is customizable, and its content can easily be saved via postback to a standard asp:TextBox.
It is possible that the editor you are using is not actually updating the input/textarea that you are using, it may be cloning the text and drawing the formatting in an overlay. You can use developer tools, or javascript, to verify this by checking the value property of the input or textarea element. If it is being saved via AJAX or javascript the code may be using the textContent or innerText properties instead of innerHTML.
I used the richtexteditor dll that's free online. it gave me a wiziwig box that the user can edit texxt in.

html page failing to display rupee currency symbol

I have a database configuration table that holds the rupee symbol &#8377.
when my page loads a java class reads this value using jdbc from the sql server database and using xslt transformation displayed in a table.
there are no issues with the $ UK pound symbol etc, but rupee will not display. In the table I see that the value &#8377 is displayed and when I view the source I see that the text has been escaped to &#8377.
If I edit the source in chrome and change &#8377 back to &#8377 it displays fine, I'm trying to work out how to prevent this escaping from occurring.
I have tried to escape the & with \&#8377however this is still encoded to\&#8377.
I have also tried directly sticking the &#8377 into the xslt sheet in line with some text like:
<h2>Some text (&#8377)</h2>
but with this it displays as 'Some text (?)'
There must be a simple solution to this one but I've not found anything so far :(

Pasting formatted text from HTML into MS Access memo form field

I have a super simple MS Access form with two fields to collect some data quickly, one of which is a memo data type, wired into a table field. I want to copy some formatted text from HTML into it and would like to preserve the formatting (bolding, fonts, italic, etc.). However, when I do Ctrl-C --> Ctrl-V, it only pastes unformatted plain text.
Is there any way I can configure my form field to accept and save formatted text? If I paste the same into MS Word, the formatting IS preserved.
You will have to open the 'source' of the HTML file, and only then copy+paste.
From the browser, you'll just see the HTML output.. and some apps, like Notepad, won't be able to store the data through a simple copy+paste. MS Word can do it, as you might already know, since it is a rich-text editor.
As for a field in MS Access, you can only preserve the formatting if you copy the source itself. It will help if you let us know which browser you are copying from, though normally, there is an option to view the source code of the page being viewed.
[edit:in response to comment]
If you want rich text to enter into an ms access field, try the first few steps here: http://office.microsoft.com/en-001/access-help/insert-or-add-a-rich-text-field-HA010014097.aspx

How to preserve the layout of textarea in the database?

I have a text area in html and a form to store the information in the database. When I click on submit, it supposed to take this text and save it in the database. For example:
"This is a text and this is a list:
1. number 1
2. number 2"
However, when I load the information from the database it looks like:
"This is a text and this is a list: 1. number 1 2. number 2"
How do I keep the layout of the textarea not changed (keep the spaces, lists, etc) without the need for the user to enter any tags.
It's being stored just fine in the database. You're outputting what was entered as plain text as HTML, and HTML ignores line breaks. You need to convert your \n characters to <br /> tags. PHP has a nl2br() function for this.
You could have them enter the data in a WSYWIG and do the work on your side to make sure it's always formatted properly - client-side users still won't have to see any tags, especially if you limit their editing options...
tinyMCE, nicEdit are two good editors