Skip to content

Commit 1488a1f

Browse files
rdalal-dord67
andauthored
DODX-13917: Undo final Twitter Markdown URL to twitter.com, instead of x.com (#138)
* Undo final Twitter Markdown URL to `twitter.com` * Fixed README.md file content --------- Co-authored-by: rdalal-do <rohitdalal67@gmail.com>
1 parent 05183f6 commit 1488a1f

File tree

5 files changed

+53
-51
lines changed

5 files changed

+53
-51
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -726,11 +726,11 @@ _No options are available for this plugin._
726726
### twitter
727727

728728
<details>
729-
<summary>Add support for <a href="https://x.com/">X</a> embeds in Markdown, as block syntax.</summary>
729+
<summary>Add support for <a href="https://twitter.com/">X</a> embeds in Markdown, as block syntax.</summary>
730730

731731
The basic syntax is `[twitter <tweet>]`.
732732
E.g. `[twitter https://twitter.com/MattIPv4/status/1576415168426573825]`.
733-
Input may use either the legacy `twitter.com` or the new `x.com` domain; both are accepted.
733+
Input may use either `twitter.com` or `x.com` domain for the tweet.
734734
After the tweet, assorted space-separated flags can be added (in any combination/order):
735735

736736
- Add `light` or `dark` to set the card theme (default is `light`).
@@ -753,13 +753,13 @@ If a width outside the range of 250-550 is selected, a clamped value will be use
753753

754754
<div class="twitter">
755755
<blockquote class="twitter-tweet" data-dnt="true" data-width="550" data-theme="light">
756-
<a href="https://x.com/MattIPv4/status/1576415168426573825">View tweet by @MattIPv4</a>
756+
<a href="https://twitter.com/MattIPv4/status/1576415168426573825">View tweet by @MattIPv4</a>
757757
</blockquote>
758758
</div>
759759

760760
<div class="twitter" align="left">
761761
<blockquote class="twitter-tweet" data-dnt="true" data-width="400" data-theme="dark">
762-
<a href="https://x.com/MattIPv4/status/1576415168426573825">View tweet by @MattIPv4</a>
762+
<a href="https://twitter.com/MattIPv4/status/1576415168426573825">View tweet by @MattIPv4</a>
763763
</blockquote>
764764
</div>
765765
<script async defer src="https://platform.twitter.com/widgets.js" type="text/javascript"></script>

fixtures/full-input.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,8 +333,9 @@ Embedding a terminal recording from Asciinema (id, cols, rows):
333333

334334
You can also embed a tweet from Twitter by passing the URL for the tweet:
335335

336-
[twitter https://x.com/MattIPv4/status/1576415168426573825]
336+
[twitter https://twitter.com/MattIPv4/status/1576415168426573825]
337337

338+
Input may use either `twitter.com` or `x.com` domain
338339
Like a few other embeds, you can also pass optional flags to customize the embed:
339340

340341
- Pass any integer value (between 250 and 550) to set a custom width for the embed (e.g. `[twitter https://twitter.com/MattIPv4/status/1576415168426573825 400]`)

fixtures/full-output.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,10 +346,11 @@ <h3 id="twitter"><a class="hash-anchor" href="#twitter" aria-hidden="true" oncli
346346
<p>You can also embed a tweet from Twitter by passing the URL for the tweet:</p>
347347
<div class="twitter">
348348
<blockquote class="twitter-tweet" data-dnt="true" data-width="550" data-theme="light">
349-
<a href="https://x.com/MattIPv4/status/1576415168426573825">View tweet by @MattIPv4</a>
349+
<a href="https://twitter.com/MattIPv4/status/1576415168426573825">View tweet by @MattIPv4</a>
350350
</blockquote>
351351
</div>
352-
<p>Like a few other embeds, you can also pass optional flags to customize the embed:</p>
352+
<p>Input may use either <code>twitter.com</code> or <code>x.com</code> domain
353+
Like a few other embeds, you can also pass optional flags to customize the embed:</p>
353354
<ul>
354355
<li>Pass any integer value (between 250 and 550) to set a custom width for the embed (e.g. <code>[twitter https://twitter.com/MattIPv4/status/1576415168426573825 400]</code>)</li>
355356
<li>Pass <code>light</code> or <code>dark</code> to switch the theme of the embed (e.g. <code>[twitter https://twitter.com/MattIPv4/status/1576415168426573825 dark]</code>)</li>

rules/embeds/twitter.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const safeObject = require('../../util/safe_object');
2828
*
2929
* The basic syntax is `[twitter <tweet>]`.
3030
* E.g. `[twitter https://twitter.com/MattIPv4/status/1576415168426573825]`.
31-
* Rendered output always canonicalizes the link to `https://x.com/<user>/status/<id>`.
31+
* Rendered output always canonicalizes the link to `https://twitter.com/<user>/status/<id>`.
3232
* After the tweet, assorted space-separated flags can be added (in any combination/order):
3333
*
3434
* - Add `light` or `dark` to set the card theme (default is `light`).
@@ -48,13 +48,13 @@ const safeObject = require('../../util/safe_object');
4848
*
4949
* <div class="twitter">
5050
* <blockquote class="twitter-tweet" data-dnt="true" data-width="550" data-theme="light">
51-
* <a href="https://x.com/MattIPv4/status/1576415168426573825">View tweet by @MattIPv4</a>
51+
* <a href="https://twitter.com/MattIPv4/status/1576415168426573825">View tweet by @MattIPv4</a>
5252
* </blockquote>
5353
* </div>
5454
*
5555
* <div class="twitter" align="left">
5656
* <blockquote class="twitter-tweet" data-dnt="true" data-width="400" data-theme="dark">
57-
* <a href="https://x.com/MattIPv4/status/1576415168426573825">View tweet by @MattIPv4</a>
57+
* <a href="https://twitter.com/MattIPv4/status/1576415168426573825">View tweet by @MattIPv4</a>
5858
* </blockquote>
5959
* </div>
6060
* <script async defer src="https://platform.twitter.com/widgets.js" type="text/javascript"></script>
@@ -174,7 +174,7 @@ module.exports = md => {
174174
// Apply the alignment to the parent div, as Twitter does float-based alignment
175175
return `<div class="twitter"${attrAlign}>
176176
<blockquote class="twitter-tweet" data-dnt="true"${attrWidth}${attrTheme}>
177-
<a href="https://x.com/${user}/status/${id}">View tweet by @${user}</a>
177+
<a href="https://twitter.com/${user}/status/${id}">View tweet by @${user}</a>
178178
</blockquote>
179179
</div>\n`;
180180
};

0 commit comments

Comments
 (0)