cstkingkey / docx-rs

A Rust library for parsing and generating docx files.
MIT License
12 stars 12 forks source link

Adding BiDirectional Child to Hyperlink #28

Closed nparent1 closed 2 weeks ago

nparent1 commented 2 weeks ago

The HyperLink class need not have a rich text run nested immediately within it - see the attached docx file for example (and the documentation).

The BidirectionalEmbedding can actually have quite a few possible children, and supports various text directions and such. For simplicity, I've omitted all of this complexity, and only use the BiDirectional class to catch the fact that hyperlinks might have their text content nested within one of these tags (since I have encountered a docx file with such a pattern).

If future docx files with more nuanced BidirectionalEmbedding tags are encountered, this class can be fleshed out.

hyperlink_with_bidirectional_embedding_level.docx