Line Wrap With SyntaxHighlight

Problem:

Syntax Highlighter has a problem where long lines of code use a horizontal scroll bar instead of using a line break or word wrap.

Example Before:

sql_query = SELECT page_id, page_title, page_namespace, page_is_redirect, old_id, old_text FROM vn_page, vn_revision, vn_text WHERE rev_id=page_latest AND old_id=rev_text_id

Solution:

If using wordpress install a plugin called ‘SyntaxHighlighter Evolved’ and after the plugin is activated go to the settings toolbar and select “SyntaxHighlighter.” Note: You must be using version 2.x of SyntaxHighlighter in order to have line wrapping work.

SyntaxHighlighter Options

Example After:

sql_query = SELECT page_id, page_title, page_namespace, page_is_redirect, old_id, old_text FROM vn_page, vn_revision, vn_text WHERE rev_id=page_latest AND old_id=rev_text_id

2 Responses

Subscribe to comments with RSS.

  • wordpress-id says:

    i have same problem, i did chage the version, but notting happen, it still wrap word

  • zaphinath says:

    I wanted the line wrap in my syntax highlights. If you don’t want the line wrap then you need to use the newer version and make sure the option is unchecked for line wrap.