Skip to content

Commit

Permalink
Remove support for non-HTML doctypes
Browse files Browse the repository at this point in the history
Related to syntax-tree/hast@2.4.0
  • Loading branch information
wooorm committed May 1, 2021
1 parent 21e9223 commit 7fd0848
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 23 deletions.
11 changes: 3 additions & 8 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,16 +191,11 @@ function root(ctx, ast, children) {
* Transform a doctype.
*
* @type {Handler}
* @param {P5Doctype} ast
* @returns {Doctype}
*/
function doctype(_, ast) {
return {
type: 'doctype',
name: ast.name || '',
public: ast.publicId || null,
system: ast.systemId || null
}
function doctype() {
// @ts-ignore Types are out of date.
return {type: 'doctype'}
}

/**
Expand Down
3 changes: 0 additions & 3 deletions test/fixtures/doctype-nameless/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
"children": [
{
"type": "doctype",
"name": "",
"public": null,
"system": null,
"position": {
"start": {
"line": 1,
Expand Down
3 changes: 0 additions & 3 deletions test/fixtures/doctype-quirksmode-ibm/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
"children": [
{
"type": "doctype",
"name": "html",
"public": null,
"system": "http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",
"position": {
"start": {
"line": 1,
Expand Down
3 changes: 0 additions & 3 deletions test/fixtures/doctype/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
"children": [
{
"type": "doctype",
"name": "html",
"public": null,
"system": null,
"position": {
"start": {
"line": 1,
Expand Down
3 changes: 0 additions & 3 deletions test/fixtures/simple/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
"children": [
{
"type": "doctype",
"name": "html",
"public": null,
"system": null,
"position": {
"start": {
"line": 1,
Expand Down
3 changes: 0 additions & 3 deletions test/fixtures/template/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
"children": [
{
"type": "doctype",
"name": "html",
"public": null,
"system": null,
"position": {
"start": {
"line": 1,
Expand Down

0 comments on commit 7fd0848

Please sign in to comment.