tinymce-plugins/codemagic — pull request #9 by bsy-web (2013-04-08 04:07:23+00:00)
Title: HTML Inline Elements support - whitespace sensitive formatting for inline tags

HTML inline elements are sensitive to whitespace. Previous version of code applied new line to all tags which introduced unwnated whitespace in rendered HTML. I added and modified logic in beautify-html.js to handle these cases.

Change notes include:
- added: (array) Parser.Utils.inline_token	- to hold list of HTML inline elements for identification
- added: (string) new TK_TAG_INLINE token	- to handle formatting of inline tags specifically
- added: (bool) Parser.found_leading_whitespace	- to help with conditional inline tag formatting
- added: (bool) Parser.found_trailing_whitespace	- to help with conditional inline tag formatting
- added: Comments through out the file to help follow flow of data and understand algorithm
- fixed: Space left when trimming whitespace after "<" inside tag (e.g. "< tag>"). Now outputs ""
- changed: get_token(), get_string, get_content(), and get_tag() only return array[string, string] (previously array[string, string] or just string)
- changed: unfinished content (unclosed tags or scripts) now get formatted even when EOF is reached
- todo: add option to print inline tags on same line as content (inline tags currently get newline if whitespace allows)
- todo: add indentation formatting for nested inline tags (e.g. italic and bold)
- todo:	create test driver script with input test cases to track how changes to this file affect final output (regression testing)