Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8902467
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T01:37:13+00:00 2026-06-15T01:37:13+00:00

I am using Alex Gorbatchev’s Syntax Highlighter to output some code, but I’m getting

  • 0

I am using Alex Gorbatchev’s Syntax Highlighter to output some code, but I’m getting an issue where it’s not retaining the initial indentation if I start the line with a php echo. For example where I would expect the following:

<pre class="brush: php;">
    <?php
        echo $variable->getScope() . " ";
        echo $variable->getName();
    ?>;
</pre>

to output the following:

    protected $variable;

it instead outputs the following:

protected $variable;

losing the indented four spaces. If I add a piece of static text on the line above it retains the spaces as intended.

I’ve also tried changing the third line to the following:

echo "    ".$variable->getScope() . " ";

which also has no effect. Here is the javascript where I am initialising Syntax Highlighter:

SyntaxHighlighter.defaults['gutter'] = false;
SyntaxHighlighter.defaults['toolbar'] = false;
SyntaxHighlighter.all()

To clarify, the highlighter is functioning as expected in every other way.

Any Ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T01:37:15+00:00Added an answer on June 15, 2026 at 1:37 am

    The syntax highlighter will indent the code, and it sees your code is in no bracket and so it does not indent. Code in a function will e.g. get indented.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the Syntax Highlighter built with Javascript by Alex Gorbatchev (http://alexgorbatchev.com/SyntaxHighlighter/download/) The
I'm using a javascript syntax highlighter ( http://alexgorbatchev.com/SyntaxHighlighter/ ). I think this one is
This is the code I'm using: <?php $expire=time()+60*60*24*30; setcookie(user, Alex Porter, $expire); ?>
I'm using mysql_fetch_object in my code, and am getting an error because the object
I'm using Alex Michael's fantastic javascript filtrr library to allow me to manipulate images
I need some help with sending info from a component. I'm not sure how
Im Using the following code to validate (poorly, I know) a form's $_POST[] ed
I am using containable to reduce the size of my finds but I have
I have been working through the tutorial by Alex Young on using flash messages
I am having problems loading some of the semantic packages that Alex Ott recommends

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.