@ampless/plugin-x-embed 1.0.0-alpha.4 → 1.0.0-alpha.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/editor.js +9 -1
  2. package/package.json +1 -1
package/dist/editor.js CHANGED
@@ -60,7 +60,15 @@ var AmplessTweetNode = Node.create({
60
60
  return [
61
61
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
62
62
  {
63
- find: TWEET_URL,
63
+ // tiptap's paste rule internally calls `String.prototype.matchAll`
64
+ // which throws when the regex doesn't carry the `g` flag. Clone
65
+ // the source regex (which is anchored `^...$` for use in the
66
+ // renderer / markdown extractor) into a global form here. Anchored
67
+ // global is fine — without the `m` flag, `^...$` only anchor at the
68
+ // start / end of the **entire input**, so this matches at most
69
+ // once for the pasted input as a whole (= exactly the single-URL
70
+ // paste case we care about).
71
+ find: new RegExp(TWEET_URL.source, "g"),
64
72
  handler: ({ range, match, commands }) => {
65
73
  const tweetId = match[1];
66
74
  if (!tweetId) return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ampless/plugin-x-embed",
3
- "version": "1.0.0-alpha.4",
3
+ "version": "1.0.0-alpha.5",
4
4
  "description": "x.com (Twitter) embed plugin for ampless — renders tweet URLs inline as blockquotes hydrated by widgets.js",
5
5
  "license": "MIT",
6
6
  "type": "module",