Skip to content

White space is ignored in nesting tags #27

Description

@OHHAKO

What?

  • I used JSSoup in this way.
    const data.contentMain = '<p> blah blah <a>blah></a> </p> <p> blah blah </p> ..... ';
   
    const splitContentMain: string[] = [];
    const soup = new JSSoup(`<div>${data.contentMain}</div>`);

    const div = soup.nextElement;
    for (const child of div.contents) {
      splitContentMain.push(`${child}`);
    }
  • and saw this situation. Surely include the white space in front of 'a' tag. but didn't show up.

스크린샷 2021-08-30 오후 4 46 26

  • and when i edit the code child with child.prettify() it shows perfectly.

스크린샷 2021-08-30 오후 4 44 52

For sure i'm glad to solve my problem. but want to make sure it's working properly.
i think prettify() is just how to show code. not for print.
Thank you!

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