@parcel/transformer-posthtml 2.0.0-nightly.846 → 2.0.0-nightly.847

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.
@@ -158,7 +158,8 @@ var _default = new (_plugin().Transformer)({
158
158
  version: '0.4.1',
159
159
  program: (0, _posthtmlParser().parser)(await asset.getCode(), {
160
160
  lowerCaseAttributeNames: true,
161
- sourceLocations: true
161
+ sourceLocations: true,
162
+ xmlMode: asset.type === 'xhtml'
162
163
  })
163
164
  };
164
165
  },
@@ -199,10 +200,13 @@ var _default = new (_plugin().Transformer)({
199
200
  },
200
201
 
201
202
  generate({
202
- ast
203
+ ast,
204
+ asset
203
205
  }) {
204
206
  return {
205
- content: (0, _posthtmlRender().render)(ast.program)
207
+ content: (0, _posthtmlRender().render)(ast.program, {
208
+ closingSingleTag: asset.type === 'xhtml' ? 'slash' : undefined
209
+ })
206
210
  };
207
211
  }
208
212
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parcel/transformer-posthtml",
3
- "version": "2.0.0-nightly.846+4308a0da",
3
+ "version": "2.0.0-nightly.847+8e1cfc90",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -20,13 +20,13 @@
20
20
  "parcel": "^2.0.0-beta.1"
21
21
  },
22
22
  "dependencies": {
23
- "@parcel/plugin": "2.0.0-nightly.846+4308a0da",
24
- "@parcel/utils": "2.0.0-nightly.846+4308a0da",
23
+ "@parcel/plugin": "2.0.0-nightly.847+8e1cfc90",
24
+ "@parcel/utils": "2.0.0-nightly.847+8e1cfc90",
25
25
  "nullthrows": "^1.1.1",
26
26
  "posthtml": "^0.16.5",
27
27
  "posthtml-parser": "^0.10.1",
28
28
  "posthtml-render": "^3.0.0",
29
29
  "semver": "^5.4.1"
30
30
  },
31
- "gitHead": "4308a0da19860b3a4ccec286a503af472fd0f4c2"
31
+ "gitHead": "8e1cfc90ff83b2ceeafac925054b46a3a2856bad"
32
32
  }
@@ -88,6 +88,7 @@ export default (new Transformer({
88
88
  program: parse(await asset.getCode(), {
89
89
  lowerCaseAttributeNames: true,
90
90
  sourceLocations: true,
91
+ xmlMode: asset.type === 'xhtml',
91
92
  }),
92
93
  };
93
94
  },
@@ -123,9 +124,11 @@ export default (new Transformer({
123
124
  return [asset];
124
125
  },
125
126
 
126
- generate({ast}) {
127
+ generate({ast, asset}) {
127
128
  return {
128
- content: render(ast.program),
129
+ content: render(ast.program, {
130
+ closingSingleTag: asset.type === 'xhtml' ? 'slash' : undefined,
131
+ }),
129
132
  };
130
133
  },
131
134
  }): Transformer);