GithubHelp home page GithubHelp logo

rcasto / adaptive-html Goto Github PK

View Code? Open in Web Editor NEW
10.0 1.0 5.0 945 KB

HTML to Adaptive Card JSON converter library

Home Page: https://rcasto.github.io/adaptive-editor/

License: MIT License

JavaScript 3.97% HTML 5.81% TypeScript 90.22%
adaptive-cards html converter authoring-tool wysiwyg adaptivecards

adaptive-html's People

Contributors

ian-speers avatar rcasto avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

adaptive-html's Issues

Conversion drops whitespaces

Hi!

We are starting to use the library but encountered an issue.

Our users create/edit text using TipTap. It is a simple editor that allows them to create text with some easy HTML tags just by typing/selecting/formatting it.

Now, they might create text like:

"... that shows our <strong>company </strong>values."

Please notice the whitespace between "company" and the closing </strong> tag. That can easily happen in the TipTap editor and it's not obvious.

The AdaptiveHtml.toJSON() method converts this into:

"... that shows our **company**values."

because the whitespace is dropped. But should it be dropped?

Try to reduce size of library

May be able to take advantage of tree shaking utilized by rollup. Only import what is needed utilizing ES6 module syntax.
Current unminified size on disk: 30kb
Current minified size on disk: 14kb

Improve replacement rule/methodology for line breaks <br />

Currently line breaks or
tags are replaced with a '\n\n'
This seems to render as a larger spacing between text elements than there should be in some channels/cases.
Would be better to leverage the spacing property of the Adaptive Card JSON schema between separate TextBlock card elements to represent a line break instead.

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.