GithubHelp home page GithubHelp logo

jfhr / deltaconvert Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 241 KB

Convert quill deltas to and from other formats

Home Page: https://npmjs.com/package/deltaconvert

License: Apache License 2.0

JavaScript 100.00%
quill quill-delta

deltaconvert's Introduction

deltaconvert's People

Contributors

jfhr avatar

Watchers

 avatar

deltaconvert's Issues

Add video support

Videos should be supported in deltaToHtml, deltaToNpf, htmlToDelta, and npfToDelta.

Considerations:

  • HTML supports multiple <src> elements. We could always pick the first one
  • NPF supports multiple ways to specify a source: media { type, url } for videos that can be played natively, embed_html, embed_iframe, embed_url and url. url would always work but we could add extra logic for some known providers (e.g. youtube)
  • Quill by default inserts videos is <iframe>s with class ql-video. We should treat these like <video>s, using the <src> attribute as the video url

Todo:

  • Add unit tests
    • deltaToHtml
    • htmlToDelta
    • npfToDelta
    • deltaToNpf
  • Implement stuff
  • Add bugs
  • Fix bugs

Support code tags

Objects of the form { insert: "foo", attributes: { code: true, /*...*/ } } should be converted into <code>foo</code>, or the equivalent on other platforms

Add deltaToSsml

SSML is an XML format for speech synthesis. See here.

At a minimum we should support:

  • top-level <speak> element
  • bold text to <emphasis> (only full sentences)
  • paragraphs to <p> elements
  • maybe sentences to <s> elements, although most TTS engines should be able to split sentences on their own

I don't see the use case for the reverse (ssmlToDelta), so that's not part of this PR

Support code blocks

#6 was about inline code, this one is about code blocks

Objects of the form { insert: "\n", attributes: { "code-block": true, /*...*/ } } should be converted into <pre><code>foo</code></pre>, or the equivalent on other platforms

For tumblr npf, we can use the chat subtype for this (see #7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.