|
|
|
|
|
by dfc
4429 days ago
|
|
Example text (example.md): Alice wants to conduct a survey of her customers. She wants to restrict
access to her customers (ie select subset of people) and she wants
customers to be able to answer openly and not worry about reprisals.
> Is there a magic token that Alice can distribute to her customers
> (Bob,Carol,etc) that demonstrates their membership in survey pool and
> protects the anonymity of their responses?
Transcript: dfc@ronin:~$ wc example.md
8 67 395 example.md
dfc@ronin:~$ .gopath/bin/markdownfmt example.md > gofmt.md
dfc@ronin:~$ wc gofmt.md
3 65 390 gofmt.md
dfc@ronin:~$ cat gofmt.md
Alice wants to conduct a survey of her customers. She wants to restrict a**SNIP**
> Is there a magic token that Alice can distribute to her customers (Bob,**SNIP**
dfc@ronin:~$
I truncated the lines in the cat gofmt.md because long preformatted colums kill HN readability. That file was 7 lines of pristine markdown with a trailing newline. markdownfmt turned it into three lines total. dfc@ronin:~$ pandoc -t markdown -o pandoc.md example.md
dfc@ronin:~$ wc pandoc.md
8 67 395 pandoc.md
dfc@ronin:~$
I am not sure what you mean by "It makes sure the last line has an ending newline, nothing more, nothing less. Any extra newlines are not visible in the generated HTML." I thought this was a markdown formatting tool?Here is a hypothetical--but common--workflow that this destroys: Author keeps multiple chapters of book in separate files for easy editing and revision control. When it is time to publish text the author executes: $ cat 1.md 2.md 3.md 4.md |publishmd --some-options
You killed my chapter titles. |
|
It would work fine if you passed `cat 1.md 2.md 3.md 4.md` as input, but removing excess newlines at the end of individual Markdown files will ruin the concatenated result.
It's similar to an issue that goimports also has [1].
I'll think about it, perhaps something can be done to solve this.
[1] https://code.google.com/p/go/issues/detail?id=7463