Josh Close

Results 279 comments of Josh Close

`RenderMarkdown` has this line in it ```cs if (prependLinkRoot && document.ContainsKey(Keys.LinkRoot)) ``` Is there any reason it needs to get it from the document? I'm using it from the context....

I created a `RelativeUrl` that parses a URL and handles `~`, query, and fragment. It's used inside `IExecutionStateGetLinkExtensions.GetLink(string path)`. I'm just calling this from the markdown renderer. Maybe this will...

> A good rule of thumb is if you have a document, get settings through the document but if you don't get them through the engine or context. That way...

I could also get all the settings from document and call the largest `GetLink` method. It would be nice to call the lowest level of just passing in a `string...

Even better idea. I'm adding a parameter `IMetadata settings = null` and then `settings ??= executionState.Settings;`.

```cs public static string GetLink( this IExecutionState executionState, string path, bool includeHost = false, IMetadata settings = null) { // Return the actual URI if it's absolute if (path is...

There is an issue with this whole idea. `LinkGenerator.GetLink` will always insert a `/` at the beginning of a URL. That means all URLs would have to be root relative....

There are markdown tests that are expecting that to not be the case. Since I'm now using `GetLink` in `RenderMarkdown`, a `/` is inserted at the front of the links.

Looking at the xml comment for `IExecutionStateGetLinkExtensions.GetLink` > Gets a link for the root of the site using the host and root path specified in the settings. it seem as...

> A relative link wouldn't need any rewriting I was just thinking all links should go through a link processor so things like `~` can be handled. Otherwise each document...