RTF format in web text editor

Is there a text editor on the Internet that supports input from RTF-formatted documents?

I know this is a bit of a strange request for webdev, but I need to read the RTF documents from the database and edit them in a text editor on the Internet and save it back to RTF. Before investing too much in a conversion tool, I thought I'd ask if any of the many RTF text editors supported. My research shows that they do not.

Also, since this is an MVC 4.6 application, would it be a huge effort to write a two-way RTF-HTML to C # conversion tool?

An example of the input that will be received by the editor: "{\rtf1\ansi{\fonttbl\f0\fswiss Helvetica;}\f0\pard This is some {\b bold} text.\par }"

+3
source share
2 answers

Quill is a rich web-based text editor.

Using the code from quickstart, you can enable it like this:

Create toolbar container

<div id="toolbar">
  <button class="ql-bold">Bold</button>
  <button class="ql-italic">Italic</button>
</div>

Create Editor Container

<div id="editor">
  <div>Hello World!</div>
  <div>Some initial <b>bold</b> text</div>
  <div><br></div>
</div>

Enable Quill Library

<script src="//cdn.quilljs.com/0.20.1/quill.js"></script>

Initialize Quill Editor

<script>
  var quill = new Quill('#editor');
  quill.addModule('toolbar', { container: '#toolbar' });
</script>

Editor text customization

editor.setText("RTF document ");

Retrieving Editor Text

by default 0 will get everything in the editor

var text = editor.getText(0);

see also Mozilla's post , which describes how to implement your own text file editor.

+3
source

You can use Word to download the RTF file and then save as HTML. It works, but generates a bunch of false MS tags.

(Visual Studio), , - ​​ , , . , ( - - ).

, , , Wamadahama .

+1

Source: https://habr.com/ru/post/1757179/


All Articles