Formatted document support / checkpoint#632
Merged
eb1 merged 29 commits intoadapt-it:masterfrom Oct 1, 2025
Merged
Conversation
Path wildcard was incorrect -- CI build now backs up the original JS, calls terser to minify, builds, then copies the original src back
Markdown import support through marked.js. This converts markdown text into html (not built yet), which will then be imported.
Markdown import (passthrough) and framework for HTML doc import
h1-h6, ul
More tags
- Add styling for italic, bold, BoldItalic, underline chars in editor - Add mt5, mt6 to special text usfm (matching h5/h6 HTML) - Attempt to pull out book name from first H1 markdown (# ) - Add HTML strong/em to bd/it usfm cases
Nesting marker tags; continue to work through html>usfm mappings
Small caps and Superscript; start on nested tags (not complete)
Nested tags working for the most part. Still need to look at ul/ol nestings, as well as the image tag and hyperlinks.
Add missing <a> html tag
Move table and li tags into regular HTML marker processing. Tables and lists are different enough between USFM and HTML that it doesn't really make sense to process them as usfm (especially since we don't use the table and list stylings when adapting).
- Remove unused aim_ tags - Add space to verse check in sourcephraselist template - encode html attributes in tag list - Still need to work on export for MD/HTML
Remove HTML tags from USFM marker export
Fix marker spacing on HTML import; move HTML tag export check / extraction earlier in USFM export code
Expose MD/HTML export (not implemented)
Basic export of Markdown files (not complete).
More progress on MD export.
Work on read of <code> elements as-is -- w/o punctuation
Refactor markdown export to use a switch case for the markers instead of a block of if statements, allowing us to handle the fallback / general HTML marker case. Looks like markdown/HTML import is generating too many \p markers -- will address this issue next.
Mostly pretty-printing between import and export. Did manage to mostly clean up the extraneous \p tags in import, and deal with html attributes on export. More work needed for figures and superscript
Superscript and aside/esb tags. Also working on removing some extraneous \p items (\li\p in a nested list is actually coming from marked.js when the markdown gets converted to html)
Quick HTML import fix
Add \\_ht_img tag as well as (lossy) \\fig tag to html import, and ignore \\fig tag on export. This preserves the <img> attributes on export.
Push recent changes: - import / add ending html marker for those usfm tags that don't have an ending (e.g., mt1) - Move HTML pre / post text to a const in the top of the file - Remove check for lastSPID in exports (problems with selection in the middle of the chapter) - First pass through html export (untested)
Just a couple of pretty printing tweaks. Still have some issues with closing markers.
More pretty-printing for md and html
export is now built in a temp string, and then transferred to the actual chapterString when theres a target/gloss/FT to export
Always add the list item for the export action to the home screen, but hide it if there are no items in the app's KB collection (this can happen if the call to fetch the KB hasn't returned yet). When the KB collection retrieval finishes, the app looks to see if the Export action is hidden, and if so, displays the action.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes # 631. Other fixes in progress.