Skip to content

Conversation

@lukemelia
Copy link
Contributor

Our use case for these additional exports is as follows:

MobiledocParser: we use it in a "cleaning" service that processes mobiledoc before saving to remove cards that have been added but not configured and so are effectively empty and should be removed.

parsePostFromHTML: we use it to let users convert older HTML content to mobiledoc, and in our tests to allow succinct creation of mobiledoc from HTML

parsePostFromText: we use it to convert text from a CSV import into mobiledoc for further editing in our UI

detect: we use it to find link markups in a mobiledoc to facilitate selection expansion when replacing a link

@lukemelia
Copy link
Contributor Author

Looks like the build failure here is related to SauceLabs credentials.

@gpoitch
Copy link
Member

gpoitch commented Nov 14, 2024

Use cases sound good.

I believe you can do these with public api:

MobiledocParser:

const post = new Editor({ mobiledoc: { version: '0.3.2', atoms: [], cards: [], markups: [['strong']], sections: [[1, 'p', [[0, [], 0, 'Foo '], [0, [0], 1, 'bar'],],],],},}).loadPost()

parsePostFromHTML:

const post = new Editor({ html: '<p>Foo <b>bar</b></p>' }).loadPost()

parsePostFromText: could add a text option and perform like above.

detect: seems like a pretty basic utility to just copy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants