is there a frictionless way to save input with multiple lines in firebase?

前端 未结 1 809
挽巷
挽巷 2021-01-21 17:57

I\'d like a user to be able to type several paragraphs as a firebase input and have the newlines/returns/enter preserved for formatting purposes. Neither the firechat or the mor

相关标签:
1条回答
  • 2021-01-21 18:42

    I'd suggest checking out Firepad.

    • Firepad is a drop-in "Open source collaborative code and text editing" experience for Firebase apps.
    • It is definitely frictionless.
    • It will allow you to create the rich text-editor experience you're looking for.

    As the documentation describes, this is how you initialize Firepad:

    <div id="firepad"></div>
    <script>
      var firepadRef = new Firebase('<FIREBASE URL>');
      var codeMirror = CodeMirror(document.getElementById('firepad'), { lineWrapping: true });
      var firepad = Firepad.fromCodeMirror(firepadRef, codeMirror,
          { richTextShortcuts: true, richTextToolbar: true, defaultText: 'Hello, World!' });
    </script>
    
    0 讨论(0)
提交回复
热议问题