Closed wkeese closed 12 years ago
From testing at http://daringfireball.net/projects/markdown/dingus, lists and nested lists work, but the (outer) list cannot be indented. I fixed numerous violations in the dojo source related to indentation so I think that if the doc parser just strips the first two tabs, or whatever the indent is on the first line, then things will work.
Also note that with Neil's parser nested lists were hacked like this (taken from dojo/selector/acme.js):
// * attribute queries:
// | * `[foo]` attribute presence selector
// | * `[foo='bar']` attribute value exact match
// | * `[foo~='bar']` attribute value list item match
// | * `[foo^='bar']` attribute start match
// | * `[foo$='bar']` attribute end match
// | * `[foo*='bar']` attribute substring match
That doesn't work anymore either.
I'll work on a patch for this.
The first problem is here:
function processStandardKey(/**Object*/ metadata, /**string*/ key, /**string*/ line) {
key = standardKeys[key];
line = trim(line);
It's indiscriminately trimming all leading whitespace, where it should only be trimming the indent of the value (by our standards, two tabs). That value isn't being recorded at all, so this is more of a case of an unimplemented feature than a bug.
The second issue is that you are expanding tabs to 2 spaces, rather than 4. Not only do dojo developers use 4 spaces for tabs, but markdown requires 4 spaces for indenting lists (and we are using tabs to indent nested lists). Actually, it's more complicated than that, because for something like "//\t" it should expand to 2 spaces.
https://github.com/wkeese/js-doc-parse/tree/dojodoc
I'll do some more checking tomorrow though, to make sure everything is OK, and maybe work on the return codes problem too.
OK, that's the patch, seems to be working, @AdrianVasiliu you see any issues?
Same as #59
According to http://stackoverflow.com/editing-help/#advanced-lists, markdown supports nested lists by indenting four spaces.
However, it doesn't work in our doc, for example dojox/string/BidiEngine.js:
Our doc is actually using tabs rather than spaces, so as an experiment, I tried switching to spaces, but that didn't help.
cc @AdrianVasiliu