Skip to content

Formatted document support / checkpoint#632

Merged
eb1 merged 29 commits intoadapt-it:masterfrom
eb1:master
Oct 1, 2025
Merged

Formatted document support / checkpoint#632
eb1 merged 29 commits intoadapt-it:masterfrom
eb1:master

Conversation

@eb1
Copy link
Copy Markdown
Contributor

@eb1 eb1 commented Oct 1, 2025

Fixes # 631. Other fixes in progress.

eb1 added 29 commits July 16, 2025 12:55
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
- 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.
@eb1 eb1 merged commit d94a9e8 into adapt-it:master Oct 1, 2025
1 check passed
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.

1 participant