Hi, @manoharreddyporeddy, and All,
Continuation of the previous post !
Now, we must determinate all the levels of these relative paths, found in a specific text. In other words, how many ../ syntaxes exist !
We’ll use easy regexes, below, and simply click on the Count button, in the Find dialog
•----•----------------------------------------------------------------------•--------------------------•----------------------------------------------------------------------•-----------------•
| ST | SEARCH | REPLACEMENT | COMMENTS | NUMBER |
•----•----------------------------------------------------------------------•--------------------------•----------------------------------------------------------------------•-----------------•
| | \((\.\./){4,}\w | | 0 zone (../../../ /../xxxx/xxxx/xxxxxxx) | 0 Occurrence |
| | | | | |
| | \((\.\./){3}\w | | 16 zones (../../../xxxx/xxxxxxxx) => Future use of QAUNTIFIER {3} | 16 Occurrences |
| | | | | |
| 14 | \((\.\./){2}\w | | 0 zone (../../xxxx/xxxx/xxxxxx) => | 0 Occurrence |
| | | | | |
| | \((\.\./){1}\w | | 6 zones (../xxxx/xxxx/xxxxxxxxx) => Future use of QAUNTIFIER {1} | 6 Occurrences |
| | | | | |
| | \.md\(\w | | 33 zones (xxxx/xxxx/xxxxxxxxxxxx) => Future use of QAUNTIFIER {0} | 33 Occurrences |
•----•----------------------------------------------------------------------•--------------------------•----------------------------------------------------------------------•-----------------•
From the table, above, we deduce that, in your text, only relative paths beginning with (../../../ or (../ and, of course, some without any part ../, occur
So, we’re going to reconstitute all the absolute paths, in reverse order. That is to say, beginning with relative paths containing (../../../xxxx/yyyy/zzzz/name.ext, then with (../xxxx/yyyy/zzzz/name.ext and, finally, simple forms (xxxx/yyyy/zzzz/name.ext
The number of sections ../ are indicated in the quantifier {#}, at two locations for each regex
Note that each regex dot char ( . ), below, has been replaced with the [^()[] syntax, which represents any single char, different from any parenthesis character ( and ) and from an opening square bracket [. Indeed, one must plan the possibility of several links in a single line and/or possible other block(s) of parentheses, eventually nested !
•----•----------------------------------------------------------------------•--------------------------•----------------------------------------------------------------------•-----------------•
| ST | SEARCH | REPLACEMENT | COMMENTS | NUMBER |
•----•----------------------------------------------------------------------•--------------------------•----------------------------------------------------------------------•-----------------•
| 15 | (?-si)\](http[^()[]+/)([^()[]+?/){3}[^()[]*\((\.\./){3}([^()[]+)\) | ]\x20\(\x20\1\4\x20\) | RELATIVE links (../../../xxxx/xxxxx) are changed as ABSOLUTE links | 16 Occurrences |
| | | | | |
| 16 | (?-si)\](http[^()[]+/)([^()[]+?/){2}[^()[]*\((\.\./){2}([^()[]+)\) | ]\x20\(\x20\1\4\x20\) | RELATIVE links (../../xxxxx/xxxxxxx) are changed as ABSOLUTE links | 0 Occurrence |
| | | | | |
| 17 | (?-si)\](http[^()[]+/)([^()[]+?/){1}[^()[]*\((\.\./){1}([^()[]+)\) | ]\x20\(\x20\1\4\x20\) | RELATIVE links (../xxxx/xxxx/xxxxxx) are changed as ABSOLUTE links | 6 Occurrences |
| | | | | |
| 18 | (?-si)\](http[^()[]+/)([^()[]+?/){0}[^()[]*\((\.\./){0}([^()[]+)\) | ]\x20\(\x20\1\4\x20\) | RELATIVE links (xxxx/xxxx/xxxxxxxxx) are changed as ABSOLUTE links | 33 Occurrences |
•----•----------------------------------------------------------------------•--------------------------•----------------------------------------------------------------------•-----------------•
Finally, if occurrences were found, at step 10, we slightly modify the output of the composite links [![.....] ( ..... )] ( ..... ), again, for readability :
•----•----------------------------------------------------------------------•--------------------------•----------------------------------------------------------------------•-----------------•
| ST | SEARCH | REPLACEMENT | COMMENTS | NUMBER |
•----•----------------------------------------------------------------------•--------------------------•----------------------------------------------------------------------•-----------------•
| 19 | (?-si)\[(!\[.+?]\x20\(\x20http.+?\))\] | \1\x20- | CHANGE [![....] ( .... )] ( .... ) as ![....] ( .... ) - ( .... ) | 0 Occurrence |
•----•----------------------------------------------------------------------•--------------------------•----------------------------------------------------------------------•-----------------•
To end, some simple tasks remain to do :
You may need to remove or add a few blank lines for a better presentation
You may delete all trailing blank characters
In few cases, some numbered markdown lists are still shown as :
1. bla blah
1. bla blah
1. bla blah
Simply, renumber these lines, as usual :
1. bla blah
2. bla blah
3. bla blah
So, in order to recapitulate the links’s management :
The syntax [Text](Absolute address) has been changed into [Text] ( Absolute address )
The syntax  has been changed into ![Text] ( Absolute address to xxxxx.png )
The syntax [Text](Address to xxxxx.md) has been changed into [Text] ( Absolute Address to xxxxx.md )
The syntax [](Address to xxxxx.md) has been changed into [Text] ( Absolute address to xxxxx.png ) - ( Absolute address to xxxxx.md )
The syntax [!INCLUDE [Text](Address to xxxxx.md)] has been changed into [INCLUDE] ( Absolute address to xxxxx.md )
IMPORTANT :
I preferred to keep the alternate text of the links between square brackets for readability => [alternate text]
Note that all the links, related to a picture, have an ! symbol before the alternate text
I also kept all the absolute paths between parentheses, separated from the [alternate text] part by one space character
However, after tests, I realized that in order that a link, between parentheses, is fully functional, you must surround the address with space chars. So, the final syntax used is ( https://....../name.ext )
All links are functional but the two links, beginning with (/xxx, at lines 43 and 271 of the initial text
May be, these links, below, about Markdown syntax, could be valuable :
On GitHub
https://help.github.com/en/github/writing-on-github/basic-writing-and-formatting-syntax
https://github.github.com/gfm/
On Window Azure
https://github.com/Huachao/azure-content/blob/master/contributor-guide/custom-markdown-extensions.md
Best Regards,
guy038
P.S. : I also tested the raw pages, from these two links. This helped me to identify some special cases ;-))
https://github.com/MicrosoftDocs/azure-devops-docs/blob/master/docs/organizations/settings/show-bugs-on-backlog.md
https://github.com/MicrosoftDocs/azure-devops-docs/blob/master/docs/organizations/settings/work/customize-process.md