markup icon indicating copy to clipboard operation
markup copied to clipboard

reST: linguist-language override is ignored

Open pjeby opened this issue 8 years ago • 3 comments

This is similar to #578, but with two key differences:

  • The language that doesn't work is restructuredText, not markdown
  • The files have a .txt extension, rather than no extension

Despite adding a .gitattributes of:

*.txt linguist-language=reStructuredText

The .txt files are rendered as syntax-highlighted plain text, rather than processed as markup. Ideally, markup would respect the .gitattributes, as I'm trying to migrate some older projects to Github and I don't want to pollute the commit history and disturb the codebase (the .txt files are used to generate tests and docs, so renaming them would require possibly-breaking code changes).

A sample repo with the issue can be seen here -- the .gitattributes should make this .txt file reST, but it is rendered as plain text, syntax-highlighted as reST, rather than as reST markup.

pjeby avatar Sep 05 '17 16:09 pjeby

+1 on this, having the markup renderer respect linguist-language overides would be super helpful for me.

TGNThump avatar Feb 19 '20 00:02 TGNThump

Just ran into this and the linguist team pointed me to this repo as the source of the problem: https://github.com/github/linguist/issues/6331

JLLeitschuh avatar Mar 21 '23 14:03 JLLeitschuh

Given this issue has been existing for more than 6 yrs, I'm adding my vote to it as a comment along with up-voting initial message with 👍🏻

yermulnik avatar Oct 24 '23 20:10 yermulnik

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Dec 07 '24 12:12 github-actions[bot]

😢

yermulnik avatar Dec 07 '24 15:12 yermulnik

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Feb 06 '25 12:02 github-actions[bot]

yermulnik avatar Feb 06 '25 21:02 yermulnik

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Apr 08 '25 12:04 github-actions[bot]