Skip to content
This repository has been archived by the owner on Feb 28, 2022. It is now read-only.

Support Internal Embeds #270

Merged
merged 5 commits into from
Apr 25, 2019
Merged

Support Internal Embeds #270

merged 5 commits into from
Apr 25, 2019

Conversation

trieloff
Copy link
Contributor

Fixes #267

So far only the detection of local embeds has been implemented. As this requires access to some additional properties, many tests are broken for the time being

See #267
The internal embed handler now requires access to some additional request properties that were not
mocked in all test cases

for #267
@codecov
Copy link

codecov bot commented Apr 18, 2019

Codecov Report

Merging #270 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #270   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          40     40           
  Lines         982   1039   +57     
  Branches      202    228   +26     
=====================================
+ Hits          982   1039   +57
Impacted Files Coverage Δ
src/utils/embed-handler.js 100% <100%> (ø) ⬆️
src/html/find-embeds.js 100% <100%> (ø) ⬆️
src/utils/mdast-to-vdom.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b1329ef...575391d. Read the comment docs.

…tions

The VDOMTransformer's `handler` functions did not allow for recursive processing of child nodes so
far, i.e. when a handler function wanted to process only a single MDAST node, but hand the
processing of all MDAST child nodes back to the original transformer, it had no way of doing so,
making each `handler` function a terminal node. With this change, the signature of `handler`
functions changes to `handler(callback, node, parent, handlechild)` where `handlechild(callback,
childnode, mdastparent, hastparent)` is a callback itself that takes the current HTAST-constructing
`callback`, the MDAST `childnode` that should get transformed, the `mdastparent`, i.e. the current
node from the vantage point of the `handler` function, and with `hastparent` a HAST parent node that
the output of the child processing will be attached to.
Until now, a failed ESI include would fail silently, without a possible fallback. This change falls
back to the markdown rendered as HTML in case the ESI does not work, giving at least an
approximation of the content created.

fixes #267
@trieloff trieloff marked this pull request as ready for review April 18, 2019 08:17
@trieloff trieloff merged commit cacce13 into master Apr 25, 2019
@adobe-bot
Copy link

🎉 This PR is included in version 1.8.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@kptdobe kptdobe deleted the internal-embed branch April 26, 2019 06:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Internal Embeds
2 participants