Skip to content

”selfClosingTags“ not work #1143

Open
@missannil

Description

import serialize from "dom-serializer";
import { parseDocument } from "htmlparser2";
  const html = `
                      <div class="container">
		                    <foo  />
                      </div >`;  
                   
  const result = serialize(parseDocument(html), { selfClosingTags: true, xmlMode: true})
  
  // result =   `<div class="container">
  //              <foo>
  //             </foo></div>`
  
  // expect  `<div class="container">
  //               <foo />
  //             </div>`
 

I don't get what I expect. What configuration error did I make?

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions