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
Example block may change single * to double ** #77
Comments
Fixed conversion of single to double star within example blocks and spans under certain circumstances. Closed by a85a42b. The problem was with appledoc treating single star as bold and single underscore as italics while Markdown treats single star or underscore as italics and double star or underscore as bold. This requires appledoc preprocessing comment text and converting any single star marker to double star. However as Markdown processor doesn't convert markers inside code blocks, this effectively changed the layout in there. To further complicate the issue, appledoc preprocessor doesn't know in advance whether certain part of text will be converted to code block or not. To compensate, appledoc now leaves original markers untouched and uses placeholder strings when converting single stars to double ones. These placeholders are caught and properly handled later on, in generated HTML where detecting code block or span is simple. |
I had this issue with my projects, and when I saw it was fixed, I checked the dev branch out, and now I have ugly *~!# instead of my * (in a code block) for example NSObject *object = [[NSObject alloc] init] transforms into NSObject *~!#object = [[NSObject alloc] init] |
Will check this, I thought it was affecting two stars, but obviously single one is also affected. This is the side effect of using external library for parsing Markdown. The **~!# markup is appledoc placeholder so that I can cleanup and properly handle example blocks. Should be easy to fix. Oh, I will move main development to master branch and delete development branch as it's causing misunderstandings. GitHub users expect to have master branch as the front-most branch for project... |
Sorry, GitHub closed the issue when pushing data... I'm trying to replicate the issue, but can't. |
Ok, check it out a bit and found two issues with code: first is cleaning up Markdown remote member links (i.e. |
The regex used to detect Markdown links, didn't handle remote member links due to usage of square braces. The result was extra text in comment blocks and inline code (i.e instead of `[Class method]`, the result was `[Class method](Class.html#//api/...)`) The new regex handles both cases and with unit tests working we should work fine now (hope :)
This example block:
Will be converted to:
The reason is in Markdown preprocessing which converts single * to double ** (note that it would be fine as long as only a single star is used). This should not be handled in example blocks and code sections. After converting to full Markdown support, detecting example blocks is not as simple as it was before (previously appledoc converted any tab or spaces prefixed blocks of lines into example blocks, but Markdown handles it differently based on previous context - list items for example).
This would also solve false invalid cross reference warnings handling from within example blocks - see #72.
The text was updated successfully, but these errors were encountered: