Closed nholden closed 1 year ago
Thank you for your contribution :smile:
The hyperlink with date formatting still has implicit URI encoding.
<a href="https://example.com/?x=y%3Az">
<time datetime={1234567890}>{'test: {date_short}'}</time>
</a>
<!date^1234567890^test: {date_short}^https://example.com/?x=y%253Az|test: Feb 13, 2009>
In addition, ^
also should escape in the link with date formatting. If not, a hyperlink will truncate raw ^
character and after chars.
Thanks, @yhatt! Great catch.
I took a stab at addressing that in https://github.com/yhatt/jsx-slack/pull/289/commits/efed184da3ea7a66395509ccc8edbe05c8623a70. Looks good in the Block Kit Builder, but I'm open to other approaches!
In https://github.com/yhatt/jsx-slack/issues/288, @mrcljx pointed out that characters in link URLs that are already escaped get escaped again. For example:
is encoded as
This PR removes implicit encoding from link URLs. Following @yhatt's recommendation, it ensures we continue to escape characters that Slack reserves.
&
,<
, and>
are replaced by corresponding HTML entities, and we continue to useurlEncode
to escape|
.closes https://github.com/yhatt/jsx-slack/issues/288