@pathmx/embed 0.7.5 → 0.7.7

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/index.ts +10 -11
  2. package/package.json +1 -1
package/index.ts CHANGED
@@ -121,7 +121,7 @@ export function EmbedPlugin(options: EmbedPluginOptions = {}): Plugin {
121
121
  )
122
122
 
123
123
  let index = 0
124
- return app.rewriteHtml(content, [
124
+ const output = app.rewriteHtml(content, [
125
125
  [
126
126
  "a[href]",
127
127
  {
@@ -142,16 +142,15 @@ export function EmbedPlugin(options: EmbedPluginOptions = {}): Plugin {
142
142
  },
143
143
  ],
144
144
  ])
145
- },
146
- async page(content, ctx) {
147
- if (!content.includes('class="pmx-embed')) return content
148
- ctx.addAsset({ type: "stylesheet", name: "embed.css", text: styles })
149
- if (content.includes("data-pmx-embed-x"))
150
- await ctx.addBrowserBundle(
151
- new URL("./browser/x.ts", import.meta.url),
152
- "embed-x",
153
- )
154
- return content
145
+ if (output.includes('class="pmx-embed')) {
146
+ ctx.addAsset({ type: "stylesheet", name: "embed.css", text: styles })
147
+ if (output.includes("data-pmx-embed-x"))
148
+ await ctx.addBrowserBundle(
149
+ new URL("./browser/x.ts", import.meta.url),
150
+ "embed-x",
151
+ )
152
+ }
153
+ return output
155
154
  },
156
155
  }
157
156
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pathmx/embed",
3
3
  "description": "X posts, YouTube videos, and rich web link cards for PathMX.",
4
- "version": "0.7.5",
4
+ "version": "0.7.7",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "repository": {
7
7
  "type": "git",