[Question] Syntax re-arrangement
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 5.3k
- Forks
- 510
- Avg merge
- 8d 5h
- Merged PRs (30d)
- 5
Description
I stumble over an exception in the following process:
- Parse a markdown document
The following example:**#1** This is the most important thing *ever*. **#2** For sure not. `Coding` is more important - Analyze the syntax tree for certain patterns (e.g. first inline of paragraph is bold => Foo.Name = "#2")
- Re-Align some syntax elements (e.g. restructure remaining paragraph inlines into new InlineContainer)
- Normalize the re-aligned content of the paragraph (e.g. remaining text or whatever => Foo.Text = "For sure not. .....")
I had the expectation that I can re-arrange the syntax in step (3) without any issues. Similar what I would do with Newtonsoft.Json or System.Xml.Linq.
Actually the ContainerInline.AppendChild has explicit guard preventing adding a child which already has a parent.
Is there a reason for this behavior? Is there something we can do here (Cloning? Removing Guards? New Syntax concept? Alternatively, are there utilities to help me utilizing the Span information to retrieve the original text?).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the ContainerInline.AppendChild guard described in the issue, then compare the proposed cloning, guard removal, new syntax concept, and Span-based alternatives. There is no named file or test; done would require a decided approach and a concrete, agreed scope for rearranging syntax-tree elements.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100