Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Markdown preview renders monospace (code formatted) content wrong when tabs are involved #907

Open
RamRS opened this issue Jul 15, 2022 · 0 comments

Comments

@RamRS
Copy link

RamRS commented Jul 15, 2022

Preview during edit/create seems to render monospace content wrong when tabs are involved. Here is an example post: https://www.biostars.org/p/490053/

This is probably owing to how tabs are handled - vep<TAB><SPACE> might take up the same white space as <TAB><SPACE> if the tab just jumps to end of word. But if every <TAB> were being translated to 4/8/whatever <SPACE>s, the text would render differently. I personally prefer spaces for this reason, but the point is, preview and real display should handle <TAB>s the same way. This inconsistency breaks display in these cases. Can something be done about this or is it up to the markdown engine creators?

Same content as the post but here:

With tabs:

vep 	 -i Mutect2_unfiltered_10643_vs_2434.vcf.gz
	 -o Mutect2_unfiltered_10643_vs_2434_VEP.ann.vcf
	 --assembly GRCh38
	 --species homo_sapiens
	 --offline  --cache  --cache_version 99
	 --dir_cache /.vep  --everything  --filter_common
	 --fork 4  --format vcf  --per_gene  --stats_file Mutect2_unfiltered_10643_vs_2434_VEP.summary.html
	 --total_length  --vcf

Here's what that looks like:

vep ^I -i Mutect2_unfiltered_10643_vs_2434.vcf.gz$
^I -o Mutect2_unfiltered_10643_vs_2434_VEP.ann.vcf$
^I --assembly GRCh38$
^I --species homo_sapiens$
^I --offline  --cache  --cache_version 99$
^I --dir_cache /.vep  --everything  --filter_common$
^I --fork 4  --format vcf  --per_gene  --stats_file Mutect2_unfiltered_10643_vs_2434_VEP.summary.html$
^I --total_length  --vcf$

Cleanup, tabs replaced with spaces:

vep  -i Mutect2_unfiltered_10643_vs_2434.vcf.gz
     -o Mutect2_unfiltered_10643_vs_2434_VEP.ann.vcf
     --assembly GRCh38
     --species homo_sapiens
     --offline  --cache  --cache_version 99
     --dir_cache /.vep  --everything  --filter_common
     --fork 4  --format vcf  --per_gene  --stats_file Mutect2_unfiltered_10643_vs_2434_VEP.summary.html
     --total_length  --vcf

Here's the cat -A of the above block:

vep  -i Mutect2_unfiltered_10643_vs_2434.vcf.gz$
     -o Mutect2_unfiltered_10643_vs_2434_VEP.ann.vcf$
     --assembly GRCh38$
     --species homo_sapiens$
     --offline  --cache  --cache_version 99$
     --dir_cache /.vep  --everything  --filter_common$
     --fork 4  --format vcf  --per_gene  --stats_file Mutect2_unfiltered_10643_vs_2434_VEP.summary.html$
     --total_length  --vcf$

As you can see, GitHub flavored markdown handled both beautifully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant