Skip to content

Parse text value with an included (sub-) node #558

@araareon

Description

@araareon
  • [x ] Are you running the latest version?
  • [x ] Have you included sample input, output, error, and expected output?
  • Have you checked if you are using correct configuration?
  • Did you try online tool?

Description

My source file has a text value which is "interrupted" bay another node . I would like to maintain that structure.
The lib seems to wipe away the inner structure and creates a #text with the whole word "(Jahre)

Input

   <source> ( <x id="INTERPOLATION" equiv-text="{{ alter }}"/> Jahre ) </source>

Code

 const parserOptions = {
    parseTagValue: true, //default
    trimValues: true,
    ignoreAttributes: false,
    attributeNamePrefix : "@_"
}

Output

  <source>
          <x id="INTERPOLATION" equiv-text="{{ alter }}"></x>
(Jahre) </source>

expected data

I would like to keep the source data structure with the "(" before the <x..> and "Jahre )" after the </ x>

Just like the source

How can i achieve this?

Would you like to work on this issue?

  • Yes
  • No

Bookmark this repository for further updates.

Metadata

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