terminal_markdown_viewer
terminal_markdown_viewer copied to clipboard
(1) Line endings not being recognised & (2) Text formatting in tables being ignored
Hello, Apologies in advance. Just installed mdv so I might be asking v stoopid Q here - BTW I already LOVE it ... turned into a pretty commandline viewer for obsidian, all the speed of terminal w/out loosing the looks!
So I'm trying to display an md file and make it look something like a two column table with the text in one column emphasised in some way [approx like the last column "desired" in the screenshot - the top row is the text file itself, the middle row is how mdv shows it].
- The files I'm working from were written ages ago - I used spaces (not tabs) to align everything and a double pipe
||
as an arbitrary marker :: when I passed it through mdv all the line-breaks vanished. [screenshot col 1 'browser'] - I tried stripping out tabs and doubles-paces, then all the trailing whitespace, then all the possible special characters [screenshot col 3 browser attempt 2] ==> none of that worked
- I tried doing a search for
\n
and\r
but neither of those was found - which I thought was weird. - The only way I found of fixing it was to put an extra line-break into my original files [screenshot col 2: "browser_repair"].
- The same problem affected a newly created file with lines of about 75 characters, but not the shorter ones [screenshot col 4 "test"
- Because of the oddity with \n and \r I thought I should check the encoding of the files (bottom row of the screenshot] and they're all us-ascii ==> I tried converting it to a UTF-8 version but that didn't seem to help either.
- TBH a table structure would be much more elegant for the future; I can convert all my original files so I tried that but for some reason the emphasis syntax didn't show up within the table [col 4] :: but - and this really mystified me - the in-table emphasis shows up properly if I use the sample code [col 5]
So, I'm at a loss. It really feels like I'm doing something very very dim. I've tried dozens of variations but none work; and TBH it's pretty ill-informed monkey-keyboard bashing because I don't understand enough to know why my original files or my attempt at a new table aren't being processed as expected. Can anyone help me please?
EDIT - SUCCESS - Sort of. I've realised that I can show bold and emphasis formats within a table if and only if I insert a plain character between the pipe |
marker for the tablestructure and the star character(s) for the textformat ==> the Z and the A that I inserted in a few lines of the table in column 4.
Basically I can do what I want but I don't understand how/ why