Inline tag missed order and position
See original GitHub issueChecklist
- Have you asked your question on Stackoverflow or similar forum?
- Are you running the latest version?
- Have you included sample input, output, error, and expected output?
- Have you checked if you are using correct configuration?
- Did you try online tool?
Input
Issue is inline tag in text will missed position and trim all spaces
Code
const xml = require('fast-xml-parser');
const data = '<p>Test string <emphasis> test</emphasis> second part of test string</p>'
const options = {
ignoreAttributes: false
}
const result = xml.parse(data, options);
Output
{
"p": {
"#text": "Test stringsecond part of test string",
"emphasis": "test"
}
}
expected data
But it should keep “Array order”
{
"p": [
"Test string",
{ "emphasis": "test" },
"second part of test string"
]
}
Would you like to work on this issue?
- Yes
- No
Bookmark this repository for further updates.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:6 (5 by maintainers)
Top Results From Across the Web
css - Is it possible to change order of inline elements without ...
Is it possible to change order of inline elements without changing HTML? · is the text always the same for the red part?...
Read more >Inline elements - HTML: HyperText Markup Language | MDN
Inline elements are those which only occupy the space bounded by the tags defining the element, instead of breaking the flow of the...
Read more >Insert, Remove, or Move Tags and Placeholders
Represents inline HTML in source content. Tags do not need to be translated, simply inserted into the correct place within the target. By...
Read more >'script' tag, which is missing - WordPress.org
Hello,. I have a problem with AMP pages after update do WP 5.8, plugin update and Newspaper theme update. I read in one...
Read more >HTML 4 Document Type Definition - W3C
HTML has two basic content models: %inline; character level elements and text ... position in tabbing order -- onfocus %Script; #IMPLIED -- the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This is not a bug but expected behavior. However, if you need to maintain the order as per your example, we can provide some property to do that.
check
preserveOrder
option with FXPv4 and let us know if it fulfill your purpose. Create a new issue if it doesn’t