adobe / da-live

Document Authoring is an early-access technology preview from Adobe.
https://da.live
Apache License 2.0
10 stars 16 forks source link

Triple dash support #209

Closed auniverseaway closed 2 months ago

auniverseaway commented 3 months ago

As an author who uses "View document source" from AEM Sidekick, I would like the ability to copy Word-formatted section breaks and have DA convert them to HRs so I do not have to reformat docs coming from other sources.

Criteria of acceptance

  1. Convert top level <p>---</p> to <hr/> automatically.
  2. Does not convert deep occurrences... in tables, lists, etc. as Helix does not do this.

Additional thoughts

We already do this client-side when we send to preview, but it appears we no longer do this with the change over to HAST.

We could probably format this on paste using a ProseMirror plugin, but for HTML that's been directly uploaded, this won't work.

I'm curious to know what the UX is like... if the editor gets updated in real-time or if they stay as ---.

bosschaert commented 2 months ago

I think it might be possible to implement this on the da-live level. I'm currently experimenting with this, via paste handler and input handler plugins...

bosschaert commented 2 months ago

Note that for HTML that is directly uploaded to da-admin this conversion already happens in the convertSectionBreak() here: https://github.com/adobe/da-collab/blob/main/src/collab.js#L240

bosschaert commented 2 months ago

Reopening as the merge was reverted, likely due to an issue with regenerating the da-y-wrapper library.