Helper function to modify a position based on the context of the document. Returns position relative to the global document when the context is an embedded section, otherwise returns the position as is.
The position to modify.
The context of the document.
The modified position.
Helper function to modify a position based on the context of the document. Returns position relative to the global document when the context is an embedded section, otherwise returns the position as is.