simov / markdown-viewer

Markdown Viewer / Browser Extension
MIT License
1.01k stars 131 forks source link

How to View github.com/.../README.md #206

Closed PaltryProgrammer closed 1 year ago

PaltryProgrammer commented 1 year ago

Hello Thank You (i think) for providing MDV . i am merely attempting to view the page link below . as best i recall there is some technique to viewing MD files on github but i do not recall same . a quick brief examination of the MDV ReadMe file did not reveal it . instead of attempting to comprehend the eye glazing intricacies of MD language as i am merely a reasonably competent C++ programmer i instead beseech your kindness to provide self same said technique . thank you kindly

https://github.com/include-what-you-use/include-what-you-use/blob/master/README.md

simov commented 1 year ago

On the page you are referring to you have to click on the Raw button, this will lead you to another host that is raw.githubusercontent.com. Copy/paste that URL and enable it in the Advanced Option page of this extension.

PaltryProgrammer commented 1 year ago

thank you for your kind reply . may i please inquire to what raw button you refer . i only see a blank page whilst attempting to view said github.com ... README.md page

simov commented 1 year ago

Go to the Advanced Options page and:

  1. Add an entry for github.com
  2. click on it in the list of allowed origins
  3. replace its path matching regexp with an empty string

Go back to https://github.com/include-what-you-use/include-what-you-use/blob/master/README.md and refresh the page, you will see the Raw button in the upper right corner of the document.

simov commented 1 year ago

I'm starting to realize what is causing the confusion. The main issue is that the content detection inside the extension was implemented as a logical OR, instead of AND, meaning the extension checks for the content-type OR the path matching regexp, where it should have been the content-type AND the path matching regexp. This will eliminate the case where github.com servers the content with content-type not intended for the extension, but the extension ignores it, because it checks either that or the path matching regexp.

Thanks for the feedback :+1:

simov commented 1 year ago

The content detection was greatly improved in v5.1 so this shouldn't be a problem moving forward. Have a look at the new Advanced Options page for managing the allowed origins. The most significant change is that header detection and path matching are being applied together, and also the text/plain content type is included in the header detection.

What all of that means is that the extension will have a much better chance of determining the correct content to render and incorrect one to exclude. Basically all of the edge cases present in the previous implementation got eliminated.