Patch line breaking for HTML & co

1. Patch line breaking for HTML & co
2. Code cleanup