@astrojs/markdown-remark 0.9.3 → 0.9.4

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @astrojs/markdown-remark
2
2
 
3
+ ## 0.9.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [#3275](https://github.com/withastro/astro/pull/3275) [`8f8f05c1`](https://github.com/withastro/astro/commit/8f8f05c1b99d073a43af3020ba3922ea2d5b466d) Thanks [@matthewp](https://github.com/matthewp)! - Fixes regression in passing JS args to islands
8
+
3
9
  ## 0.9.3
4
10
 
5
11
  ### Patch Changes
package/LICENSE ADDED
@@ -0,0 +1,61 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021 Fred K. Schott
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
23
+
24
+ """
25
+ This license applies to parts of the `packages/create-astro` and `packages/astro` subdirectories originating from the https://github.com/sveltejs/kit repository:
26
+
27
+ Copyright (c) 2020 [these people](https://github.com/sveltejs/kit/graphs/contributors)
28
+
29
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
30
+
31
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
32
+
33
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
34
+ """
35
+
36
+
37
+ """
38
+ This license applies to parts of the `packages/create-astro` and `packages/astro` subdirectories originating from the https://github.com/vitejs/vite repository:
39
+
40
+ MIT License
41
+
42
+ Copyright (c) 2019-present, Yuxi (Evan) You and Vite contributors
43
+
44
+ Permission is hereby granted, free of charge, to any person obtaining a copy
45
+ of this software and associated documentation files (the "Software"), to deal
46
+ in the Software without restriction, including without limitation the rights
47
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
48
+ copies of the Software, and to permit persons to whom the Software is
49
+ furnished to do so, subject to the following conditions:
50
+
51
+ The above copyright notice and this permission notice shall be included in all
52
+ copies or substantial portions of the Software.
53
+
54
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
55
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
56
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
57
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
58
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
59
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
60
+ SOFTWARE.
61
+ """
@@ -22,7 +22,7 @@ const visit = _visit;
22
22
  function rehypeIslands() {
23
23
  return function(node) {
24
24
  return visit(node, "element", (el) => {
25
- if (el.tagName == "astro-island") {
25
+ if (el.tagName == "astro-root") {
26
26
  visit(el, "text", (child, index, parent) => {
27
27
  if (child.type === "text") {
28
28
  if (parent && child.value.indexOf("<!--") > -1 && index != null) {
@@ -7,10 +7,10 @@ function remarkUnwrap() {
7
7
  insideAstroRoot = false;
8
8
  astroRootNodes.clear();
9
9
  visit(tree, "html", (node) => {
10
- if (node.value.indexOf("<astro-island") > -1 && !insideAstroRoot) {
10
+ if (node.value.indexOf("<astro-root") > -1 && !insideAstroRoot) {
11
11
  insideAstroRoot = true;
12
12
  }
13
- if (node.value.indexOf("</astro-island") > -1 && insideAstroRoot) {
13
+ if (node.value.indexOf("</astro-root") > -1 && insideAstroRoot) {
14
14
  insideAstroRoot = false;
15
15
  }
16
16
  astroRootNodes.add(node);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astrojs/markdown-remark",
3
- "version": "0.9.3",
3
+ "version": "0.9.4",
4
4
  "type": "module",
5
5
  "author": "withastro",
6
6
  "license": "MIT",
@@ -15,13 +15,6 @@
15
15
  "exports": {
16
16
  ".": "./dist/index.js"
17
17
  },
18
- "scripts": {
19
- "prepublish": "pnpm build",
20
- "build": "astro-scripts build \"src/**/*.ts\" && tsc -p tsconfig.json",
21
- "build:ci": "astro-scripts build \"src/**/*.ts\"",
22
- "postbuild": "astro-scripts copy \"src/**/*.js\"",
23
- "dev": "astro-scripts dev \"src/**/*.ts\""
24
- },
25
18
  "dependencies": {
26
19
  "@astrojs/prism": "^0.4.1",
27
20
  "assert": "^2.0.0",
@@ -48,6 +41,13 @@
48
41
  "@types/mdast": "^3.0.10",
49
42
  "@types/prismjs": "^1.26.0",
50
43
  "@types/unist": "^2.0.6",
51
- "astro-scripts": "workspace:*"
44
+ "astro-scripts": "0.0.3"
45
+ },
46
+ "scripts": {
47
+ "prepublish": "pnpm build",
48
+ "build": "astro-scripts build \"src/**/*.ts\" && tsc -p tsconfig.json",
49
+ "build:ci": "astro-scripts build \"src/**/*.ts\"",
50
+ "postbuild": "astro-scripts copy \"src/**/*.js\"",
51
+ "dev": "astro-scripts dev \"src/**/*.ts\""
52
52
  }
53
- }
53
+ }
@@ -9,14 +9,14 @@ const visit = _visit as (
9
9
  ) => any;
10
10
 
11
11
  // This fixes some confusing bugs coming from somewhere inside of our Markdown pipeline.
12
- // `unist`/`remark`/`rehype` (not sure) often generate malformed HTML inside of <astro-island>
12
+ // `unist`/`remark`/`rehype` (not sure) often generate malformed HTML inside of <astro-root>
13
13
  // For hydration to work properly, frameworks need the DOM to be the exact same on server/client.
14
14
  // This reverts some "helpful corrections" that are applied to our perfectly valid HTML!
15
15
  export default function rehypeIslands(): any {
16
16
  return function (node: any): any {
17
17
  return visit(node, 'element', (el) => {
18
- // Bugs only happen inside of <astro-island> islands
19
- if (el.tagName == 'astro-island') {
18
+ // Bugs only happen inside of <astro-root> islands
19
+ if (el.tagName == 'astro-root') {
20
20
  visit(el, 'text', (child, index, parent) => {
21
21
  if (child.type === 'text') {
22
22
  // Sometimes comments can be trapped as text, which causes them to be escaped
@@ -8,7 +8,7 @@ const visit = _visit as (
8
8
  callback?: (node: any, index: number, parent: any) => any
9
9
  ) => any;
10
10
 
11
- // Remove the wrapping paragraph for <astro-island> islands
11
+ // Remove the wrapping paragraph for <astro-root> islands
12
12
  export default function remarkUnwrap() {
13
13
  const astroRootNodes = new Set();
14
14
  let insideAstroRoot = false;
@@ -19,10 +19,10 @@ export default function remarkUnwrap() {
19
19
  astroRootNodes.clear();
20
20
 
21
21
  visit(tree, 'html', (node) => {
22
- if (node.value.indexOf('<astro-island') > -1 && !insideAstroRoot) {
22
+ if (node.value.indexOf('<astro-root') > -1 && !insideAstroRoot) {
23
23
  insideAstroRoot = true;
24
24
  }
25
- if (node.value.indexOf('</astro-island') > -1 && insideAstroRoot) {
25
+ if (node.value.indexOf('</astro-root') > -1 && insideAstroRoot) {
26
26
  insideAstroRoot = false;
27
27
  }
28
28
  astroRootNodes.add(node);
Binary file