At last, I've finished code which simplifies the indentation and output accumulation of Org files. All examples passed correctly (HTML and Textile examples, code syntax highlighting), and, on my opinion, look pretty now. The code relies on idea to assign to paragraphs their major modes, i.e., list items form a lists, table heading, rows, and separators form a table and so on. This decision allowed me to handle open and close tags carefully, when paragraph can open its major mode, but can't close its major mode. The code includes one method only for managing indentation and that for managing output accumulation. In common, it made the code clearly, which in turn handles all examples correctly.
One obvious difference: blank lines don't get accumulated any more, because I decided to restore the default Emacs Org mode behavior when two blank lines close all modes.
Assign the paragraph type to a variable.
New pretty indentation of HTML output done, code essentially simplifi…
…ed. Currently, supports ordered and unordered lists, can broke Textile output.
Example outputs which satisfy me at the moment.
More carefully does the accumulation of output.
Corrects HTML output for definition lists and tables.
Updates examples with tables and lists.
Correction of HTML output for code blocks.
Examles of correct HTML outputs with code blocks.
Correction of HTML output for general blocks.
Examples of HTML output with correct general blocks.
Corrects the rest of HTML examples.
The rest of HTML examples corrected.
Corrects code syntax highlighting.
Code syntax highlight examples corrected.
Corrects Textile output.
Updates Textile examples.
Hey Vladimir, thanks for sharing you work again. I think you really nailed it by refactoring into major modes, this looks really good and it makes things more clear. Thanks for handling the code syntax highlight test too!
Awesome pull request.
Slight code refactoring was done, which improves accumulating block c…
Suppresses to pop mode for a blank line.
Fixes the translation of inline example.
Assigning a CSS class for HTML output was modified a little bit.
Simplifies adding lines to output buffer.
Newlines are handled carefully.
Updates examples in accordance with the previous commit.
Handles an inline example without the need of a major mode.
No major mode is needed for blocks from now, block contents is accumu…
…lated much carefully.
Line translating was moved to "output_buffer.rb", and needless access…
…ors were removed.
I completed the work on indentation, when I refactored methods for accumulating output and the maintenance of mode stack. A lot of code was modified, so now I satisfied with the results, in particular, the HTML output. All examples were updated accordingly. I'm looking forward to answer if you accept the pull request or not.
Indentation of ordinary lines was done.
Updates all examples in accordance with the previous commit.
Thanks for your contribution. I will be looking into pulling this over the weekend.
Merge branch 'vonavi/list_indentation' into master (Fixes #38)
Merged. I like the direction you are taking with refactoring this gem. This also fixed some bugs that the gem had regarding lists, so thanks again for your contribution.