Skip to content

Commit

Permalink
Merge pull request #846 from bolt-design-system/fix/WWWD-2454-include…
Browse files Browse the repository at this point in the history
…-patterns-in-share-without-escaping

RFC: Prevent escaping of other patterns included in share
  • Loading branch information
remydenton authored Aug 23, 2018
2 parents eb6e189 + cf05b3b commit 7e4be44
Showing 1 changed file with 29 additions and 19 deletions.
48 changes: 29 additions & 19 deletions packages/components/bolt-share/src/share.twig
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,17 @@

{# Share inline #}
{% if isFlat is sameas(true) %}
{% set items = items|merge([include("@bolt-components-headline/text.twig", {
tag: "span",
text: text,
weight: "bold",
transform: "uppercase",
size: "small",
attributes: create_attribute(attributes|default({})).addClass("u-bolt-color-gray-dark c-bolt-share--inline-heading")
})]) %}
{% set item %}
{% include "@bolt-components-headline/text.twig" with {
tag: "span",
text: text,
weight: "bold",
transform: "uppercase",
size: "small",
attributes: create_attribute(attributes|default({})).addClass("u-bolt-color-gray-dark c-bolt-share--inline-heading")
} only %}
{% endset %}
{% set items = items|merge([item]) %}
{% endif %}

{% for source in sources %}
Expand All @@ -44,21 +47,28 @@
{% endif %}

{% if sourceName %}
{% set items = items|merge([include("@bolt-components-link/link.twig", {
text: sourceName,
url: source.url,
icon: {
name: sourceIcon,
position: "before",
size: "medium"
},
attributes: create_attribute(attributes|default({})).addClass("js-bolt-share__"~source.name).setAttribute("target",sourceTarget)
})]) %}
{% set item %}
{% include "@bolt-components-link/link.twig" with {
text: sourceName,
url: source.url,
icon: {
name: sourceIcon,
position: "before",
size: "medium"
},
attributes: create_attribute(attributes|default({})).addClass("js-bolt-share__"~source.name).setAttribute("target",sourceTarget)
} only %}
{% endset %}

{% set items = items|merge([item]) %}
{% endif %}
{% endfor %}

{% if copyToClipboard %}
{% set items = items|merge([include("@bolt-components-copy-to-clipboard/copy-to-clipboard.twig", copyToClipboard)]) %}
{% set item %}
{% include "@bolt-components-copy-to-clipboard/copy-to-clipboard.twig" with copyToClipboard only %}
{% endset %}
{% set items = items|merge([item]) %}
{% endif %}

{% set attributes = create_attribute(attributes|default({})) %}
Expand Down

0 comments on commit 7e4be44

Please sign in to comment.