-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: Breaking changes for 2022 #57
Conversation
BREAKING CHANGE: inter-element whitespace changes
Codecov Report
@@ Coverage Diff @@
## main #57 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 44 44
Lines 3012 3079 +67
=========================================
+ Hits 3012 3079 +67
Continue to review full report at Codecov.
|
BREAKING CHANGE: empty <p></p> tags now properly sourround the following element, eg pictures
This PR will trigger a major release when merged. |
BREAKING CHANGE: all links to media and same hlx sites are relativized
BREAKING CHANGE: picture dom changed
BREAKING CHANGE: dom changes
BREAKING CHANGE: the format of the css class names changed
BREAKING CHANGE: :icons: are now replaced with <span> elements
🎉 This PR is included in version 2.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
see #40
Breaking changes
img
tagand (non-breaking):
Details
Picture Decoration
Sources
All
<img>
elements pointing to a media-bus image are converted to a<picture>
element with various<source>s
and a residual<img>
source. The sources provide 2 types (webp and the orignal) via the fastly image optimization urls).Example:
Remove Styling
All
<img>
(and<picture>
) elements that are directly wrapped by an<em>
or<strong>
element and unwrapped. Most likely, there was a formatting mistake happen in authoring and the image contained such a style. Although this should be removed during the docx2md transformation, it could have some left-over content from older content.Example:
is now:
Intrinsic image dimensions
If contained in the media link, the intrinsic image dimensions, are added as
width
andheight
attribute to the image source. This helps the browser to compute the aspect ratio.Example
Relative Links
All links (
<a href="">
) and image sources (<img src="">
) are subject to link rewriting:the same site is either the same
*.hlx.page
or*.hlx.live
domain, or thecdn.prod.domain
configured in.helix/config.json
.Example
https://main--helix-website--adobe.hlx.page/blog/article
/blog/article
https://main--helix-website--adobe.hlx3.page/blog/article
/blog/article
https://main--helix-website--adobe.hlx.live/blog/article
/blog/article
https://www.hlx.live/blog/article
/blog/article
https://main--helix-website--adobe.hlx.live/media_1234.png
./media_1234.png
Pretty print HTML output
Instead of output the entire HTML in 1 line, it's not nicely formatted.
Example
Note: this changes the amount of inter-element whitespace, which might cause problems with
textContent
. You probably need to trim thetextContent
you receive.This has a serious impact on DOM node traversing functions which now contains
text
nodes. You probably need to review their usages and replace those with the corresponding element traversing functions: the list of nodes can now contain text nodes, especially line breaks!firstChild
firstElementChild
lastChild
lastElementChild
previousSibling
previousElementSibling
nextSibling
nextElementSibling
childNodes
children
children
list only the HTMLElements. Note that it does not have aforEach
method (use can use[...node.children]
haschildnodes()
childElementCount
Clean up empty paragraphs
The previous pipeline version had some stray empty
<p></p>
injected in the html, most often before images. those are now cleaned up and became proper paragraphs.Example:
is now:
Icon Handling
Icons specified with the
:name:
or:#name
syntax are not longer converted to<img>
or<svg>
elements, but always to<span>
elements. They should be decorated accordingly on the client side.is now:
Block CSS Class Names
The CSS class names for blocks is now computed differently:
( ... )
-
.-
are removed.Example
foo
foo
foo
foo bar
foo-bar
foo-bar
!Joe\'s Pizza!'
-joe--s-pizza--
joe-s-pizza
'!Joe\'s Pizza! (small)
--joe--s-pizza---small-
joe-s-pizza
small
Sparkling (5dl glass)
sparkling--5dl-glass-
sparkling
5dl-glass
Country Fries (small, sweat&sour )
country-fries--small--sweat-sour--
country-fries
small
sweat-sour
Table-Cell layout hints
Table cells that are formatted by the author, now contain those formats as data attributes where applicable. currently the
align
andvAlign
attributes are conveyed.example: