I’m using quill editor in my template and the editor’s content is bound via [(ngModel)] to a variable in my component which is basically a text with some html tags in it. What I discovered is that if I change the variable’s value the quill editor formats its text and replaces all occurrences of the <div> tag with <p>. In my case this turned out to be very useful and I’d like to understand how this works and how to emulate this behavior in my Angular component to use it for formatting other text values? Is there a way to dynamically pass text to Quill and then get back the formatted value, e. g. via a method call on the editor?
Related
I want to create dynamic letter in angular using HTML editor. Also I need to add some variable from type script in HTML editor content
Like this image
when I view this letter I want to set value for this {{NAME}} variable from type script. Can some one help me ? This is my fist question in stack overflow
The image I can see, is not a html editor rather it's a content editor. Please use template interpolation in html editor where you've html tag
like
my name is {{first_name}}
where first_name is your dynamic variable..
Hope you can understand what I mean to say.
I am not sure if the title represents what exactly I need to do, But here is the details. I am building a website using PHP that allows people to create different templates, then they should select one of them and then fill the fields to fill the placeholders. For example consider the following image
The name of the recipient could be a placeholder so some part of the template can be
Dear {recipient}
{body}
and I prepare two fields for recipient and the body and it will be replaced by the value of the corresponding field. I can do this. What I can't do is how to let the user to align the placeholders in the paper. For example there is a placeholder for the date that must be at right of the page, or any other placeholder that can be place inside the paper (same as the following image). I would like to know if ckeditor or any other editor allows me to create such template?
The structure of the template must be kept in A4 or A5 print page.
I’m having trouble understanding your question. If you're looking for templates in TinyMCE editor, I think you should try using template plugin for tinymce - there is one for wordpress. You can write your own plugin too, there was question about it.
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.
I have a html page having some static text as well as some controls like dropdownlist and textbox etc along with a button e.g., "Download as pdf".I need to generate a pdf file using angularjs taking the selected value of dropdownlist and value of textbox etc alongwith static content.
The page also uses some external fonts in addition to custom CSS. I need all these in my pdf.
Is it possible in jsPDF?
I tried using fromHTML():- but it only prints the text of text nodes only.
Then I tried using some built-in functions like setFont(), setFontType() etc. I also tried addFont(), but I couldn't figure out what to be passed in font style.
I even tried adding my font in the standardFonts array of addFonts() function in jsPDF library and install my external font in the system(windows folder/fonts). But it's not working.
As jsPDf has some limited designing features only, it is not meeting my requirements.
Is there any other strong tool which I can use?
TinyMCE is used in one of my projects as it was meant to be used; a WYSIWYG HTML editor.
I created a number of plug-ins for it that inserts certain fragments of text into the HTML and all is working fine. The plug-ins use TinyMCE's createMenuButton to create a menu button and tinyMCE.activeEditor.execCommand('mceInsertContent', ...) to do the inserting.
Now I need to add an editor for plain text in the same project. The text-only editor would also need to be able to insert those same fragments of text into plain <textarea> or <input type="text"> inputs.
Rather than duplicating code, I'd like to re-use the plug-ins written for TinyMCE.
Is there any way to either use TinyMCE as a plain text editor or use just the individual plug-ins?
I'm using TinyMCE 3 and can't upgrade to 4 due to missing essential features.
You could use the editor "as is", but strip the html tags afterwards.