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

Example block may change single * to double ** #77

Closed
tomaz opened this issue Mar 2, 2011 · 5 comments
Closed

Example block may change single * to double ** #77

tomaz opened this issue Mar 2, 2011 · 5 comments
Labels

Comments

@tomaz
Copy link
Owner

tomaz commented Mar 2, 2011

This example block:

- (void)doThis:(NSString *)value1 withThis:(NSString *)value2;

Will be converted to:

- (void)doThis:(NSString **)value1 withThis:(NSString **)value2;

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.

@tomaz
Copy link
Owner Author

tomaz commented Mar 14, 2011

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.

@poussain
Copy link

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]

@tomaz tomaz reopened this Apr 11, 2011
@tomaz
Copy link
Owner Author

tomaz commented Apr 11, 2011

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...

@tomaz tomaz closed this as completed in a85a42b Apr 11, 2011
@tomaz tomaz reopened this Apr 11, 2011
@tomaz
Copy link
Owner Author

tomaz commented Apr 11, 2011

Sorry, GitHub closed the issue when pushing data...

I'm trying to replicate the issue, but can't. !~# is placeholder for single stars markers, however there should be two of them in the same section (i.e. example block), it should leave single stars untouched. Can you post the whole of the comment text (or send me a private message through inbox)?

@tomaz
Copy link
Owner Author

tomaz commented Apr 25, 2011

Ok, check it out a bit and found two issues with code: first is cleaning up Markdown remote member links (i.e. [[Class method]](address)). Currently, appledoc regex doesn't parse such strings properly. Second part is due to appledoc handling of single star placeholders when two are found in separate example blocks. Working on both at the moment, so hopefully it'll be fixed soon.

tomaz added a commit that referenced this issue Apr 25, 2011
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 :)
@tomaz tomaz closed this as completed in 7a8c316 Apr 25, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants