Replace the given source reference by the given entity reference in the macro block. The method returns an
optional containing a modified macro block if it needs to be updated, else it returns an empty optional.
Depending on the macro implementation, this method might lead to parsing the macro
content for finding the reference, or might just modify the macro parameters.
macroBlock - the macro block in which to replace the reference.
currentDocumentReference - the reference of the document in which the block is located
sourceReference - the reference to replace.
targetReference - the reference to use as replacement.
relative - if true indicate that the reference should be resolved relatively to the current document
an optional containing the new macro block with proper information if it needs to be updated, else
an empty optional.