Skip to content

<meta> in body resets indentation #12

@tdlewis77

Description

@tdlewis77
my $tree = HTML::TreeBuilder->new();
$tree->parse("<html><head></head><body><div><h1>1</h1><p>1</p></div><div><h1>2</h1><meta/><p>2</p></div></body></html>");
$tree->dump;
<html> @0
  <head> @0.0
    <meta /> @0.0.0 # Instead of @0.1.1.1
  <body> @0.1
    <div> @0.1.0
      <h1> @0.1.0.0
        "1"
      <p> @0.1.0.1
        "1"
    <div> @0.1.1
      <h1> @0.1.1.0
        "2"
    <p> @0.1.2 # Instead of @0.1.1.2
      "2"

Note: I don't know why a website author would do this, but I encountered a site that did.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions