You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When creating a basic text field on a landing page, and adding Media embed of type Document, If a caption is included with the embed, The end-result on the page will display an indented document link, with a caption that is not using the Document Link's caption style.
To Reproduce
Steps to reproduce the behaviour:
Create a new Landing Page
Add a Basic Text WYSIWYG
Add a Media embed for a document with a caption
Complete creating the landing page and save
View the page on the front-end
Observe the indented / incorrectly styled caption.
Actual behaviour
The document link is appearing indented, with a differently styled caption text.
Screenshots
This is using the caption field provided by Drupal media embed:
Versions
Ripple: 1.22.0
Desktop (please complete the following information):
OS: macOS
Browser Firefox / Chrome
Version: Latest
Additional context
From what I can see of the HTML:
An expected document link should output like:
<figureclass="rpl-document-link"><aaria-label="This is the name of the document File type: pdf. Size: 1.4 mb" href="https://www.google.com" target="_blank" class="rpl-document-link__link"><!-- <svg>Removed embedded svg for clarity</svg> --><divclass="rpl-document-link__info"><spanclass="rpl-document-link__title">This is the name of the document</span><divclass="rpl-document-link__meta"><spanclass="rpl-document-link__type">pdf</span><spanclass="rpl-document-link__size rpl-document-link__size--seperator">1.4 mb</span></div></div></a><figcaptionclass="rpl-document-link__caption">This is a longer description of the document above.</figcaption></figure>
But what is being output by the Markup component is:
<figurerole="group" class="caption caption-drupal-entity"><figureclass="rpl-document-link"><aaria-label="Demo Sample Document File type: docx. Size: 7.53 KB" href="/sites/default/files/tide_demo_content/sample.docx" download="" class="rpl-document-link__link"><!-- <svg>Removed embedded svg for clarity</svg> --><divclass="rpl-document-link__info"><spanclass="rpl-document-link__title">Demo Sample Document</span><divclass="rpl-document-link__meta"><spanclass="rpl-document-link__type">docx</span><spanclass="rpl-document-link__size rpl-document-link__size--seperator">7.53 KB</span></div></div></a><!----></figure><figcaption>This is a caption!</figcaption></figure>
Where a figure with a figcaption is wrapping the document link figure.
I believe this is because the markup-plugin that swaps out the Drupal embed with the Vue component doesn't check if it's being wrapped by a figure with caption.
If the markup plugin could also check for any document embeds within a figure, then replace the figure with the document link (with caption passed to the document link component), this should fix the issue.
The text was updated successfully, but these errors were encountered:
Describe the bug
When creating a basic text field on a landing page, and adding Media embed of type Document, If a caption is included with the embed, The end-result on the page will display an indented document link, with a caption that is not using the Document Link's caption style.
To Reproduce
Steps to reproduce the behaviour:
Expected behaviour
A Document Link caption should render as per the Document Link component.
https://www.ripple.sdp.vic.gov.au/?path=/story/molecules-documentlink--document-link
Actual behaviour
The document link is appearing indented, with a differently styled caption text.
Screenshots
This is using the caption field provided by Drupal media embed:
Versions
Desktop (please complete the following information):
Additional context
From what I can see of the HTML:
An expected document link should output like:
But what is being output by the Markup component is:
Where a figure with a figcaption is wrapping the document link figure.
I believe this is because the markup-plugin that swaps out the Drupal embed with the Vue component doesn't check if it's being wrapped by a figure with caption.
If the markup plugin could also check for any document embeds within a figure, then replace the figure with the document link (with caption passed to the document link component), this should fix the issue.
The text was updated successfully, but these errors were encountered: