What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 128 Stack Exchange communities.

thanks everyone for the tips for the workaround, but what I am trying to do is report a bug with the parser.

if i try to put this text inside <pre>, this happens:

Merge Left Join (cost=14135.74..14138.08 rows=1000 width=16) Merge Cond: (generate_report.generate_report = (date_trunc('hour'::text, f.event_happened_at))) -> Sort (cost=12.97..13.47 rows=1000 width=8) Sort Key: generate_report.generate_report -> Function Scan on generate_report (cost=0.00..3.00 rows=1000 width=8) -> Sort (cost=14122.77..14122.81 rows=67 width=16) Sort Key: (date_trunc('hour'::text, f.event_happened_at)) -> HashAggregate (cost=14121.93..14122.17 rows=67 width=8) -> Hash Join (cost=3237.14..14121.86 rows=67 width=8) Hash Cond: (b.foo_id = f.id) -> Index Scan using index_bars_on_thing_type_and_thing_id_and_baz on bars b (cost=0.00..10859.88 rows=10937 width=4) Index Cond: (((thing_type)::text = 'Dog'::text) AND (thing_id = 26631)) -> Hash (cost=3131.42..3131.42 rows=30207 width=12) -> Seq Scan on foos f (cost=0.00..3131.42 rows=30207 width=12) Filter: (age((('now'::text)::date)::timestamp without time zone, event_happened_at)
share|improve this question
2  
Why don't you just use the standard formatting rule? Indent it with 4 spaces (or select the block and then press either the {} button in message editor toolbar or the Ctrl+K key)? This is clearly explained in the toolbar button tooltip and the code formatting help which is available behind the question mark on the right top of the message editor. –  BalusC Dec 5 '12 at 18:30
    
Because it is not source code. I don't want syntax highlighting (SO will guess wrongly about what language it is) –  John Bachir Dec 5 '12 at 18:36
    
hey @Chichiray, why did you change my post so that my example of the parser breaking is no longer an example of the parser breaking? –  John Bachir Dec 5 '12 at 18:54
    
and then changed it back i guess... –  John Bachir Dec 5 '12 at 18:55
    
Sorry, this was an accident. I intented to edit my post, but your post was also in edit mode and I pressed the tab + enter key wrongly after making the edit in my post, causing your post to be submitted with the "fix" :) –  BalusC Dec 5 '12 at 18:57

2 Answers 2

up vote 3 down vote accepted

When using the <pre> manually instead of using Markdown formatting rules, you'd have to escape HTML special characters yourself. So e.g. the < has to become &lt; (which is also the root cause of your concrete problem; there's an <= in the last line which should be &lt;=).

Coming back to the reason why you intented to use the <pre>,

I don't want syntax highlighting (SO will guess wrongly about what language it is)

just put <!-- language: none --> on top of the block to turn it off.

So, effectively, your post should look like this:

Blah lorem ipsum blah.

<!-- language: none -->

    Merge Left Join  (cost=14135.74..14138.08 rows=1000 width=16)
      Merge Cond: (generate_report.generate_report = (date_trunc('hour'::text, f.event_happened_at)))
      ->  Sort  (cost=12.97..13.47 rows=1000 width=8)
            Sort Key: generate_report.generate_report
            ->  Function Scan on generate_report  (cost=0.00..3.00 rows=1000 width=8)
      ->  Sort  (cost=14122.77..14122.81 rows=67 width=16)
            Sort Key: (date_trunc('hour'::text, f.event_happened_at))
            ->  HashAggregate  (cost=14121.93..14122.17 rows=67 width=8)
                  ->  Hash Join  (cost=3237.14..14121.86 rows=67 width=8)
                        Hash Cond: (b.foo_id = f.id)
                        ->  Index Scan using index_bars_on_thing_type_and_thing_id_and_baz on bars b  (cost=0.00..10859.88 rows=10937 width=4)
                              Index Cond: (((thing_type)::text = 'Dog'::text) AND (thing_id = 26631))
                        ->  Hash  (cost=3131.42..3131.42 rows=30207 width=12)
                              ->  Seq Scan on foos f  (cost=0.00..3131.42 rows=30207 width=12)
                                    Filter: (age((('now'::text)::date)::timestamp without time zone, event_happened_at) <= '24:00:00'::interval)

Blah dolor sit amet blah.

See also:

share|improve this answer
    
thanks, that's a good workaround. but the parser still has a bug AFAIK, and that's what i'm reporting. –  John Bachir Dec 5 '12 at 18:50
1  
See answer update then. –  BalusC Dec 5 '12 at 18:55
    
::facepalm:: of course. –  John Bachir Dec 5 '12 at 18:56
    
you may want to edit your answer so that the reason why my "bug" is not a bug is at the top, and the recommendation for a better solution is at the bottom. –  John Bachir Dec 5 '12 at 18:57
1  
Fair point. Edited answer. –  BalusC Dec 5 '12 at 19:00

Don't use <pre>; I don't even know why SO allows it. If it's a block quote, use >:

Merge Left Join (cost=14135.74..14138.08 rows=1000 width=16) Merge Cond: (generate_report.generate_report = (date_trunc('hour'::text, f.event_happened_at))) -> Sort (cost=12.97..13.47 rows=1000 width=8) Sort Key: generate_report.generate_report -> Function Scan on generate_report (cost=0.00..3.00 rows=1000 width=8) -> Sort (cost=14122.77..14122.81 rows=67 width=16) Sort Key: (date_trunc('hour'::text, f.event_happened_at)) -> HashAggregate (cost=14121.93..14122.17 rows=67 width=8) -> Hash Join (cost=3237.14..14121.86 rows=67 width=8) Hash Cond: (b.foo_id = f.id) -> Index Scan using index_bars_on_thing_type_and_thing_id_and_baz on bars b (cost=0.00..10859.88 rows=10937 width=4) Index Cond: (((thing_type)::text = 'Dog'::text) AND (thing_id = 26631)) -> Hash (cost=3131.42..3131.42 rows=30207 width=12) -> Seq Scan on foos f (cost=0.00..3131.42 rows=30207 width=12) Filter: (age((('now'::text)::date)::timestamp without time zone, event_happened_at) <= '24:00:00'::interval)

In this case, you probably want to make it a code snippet (indent each line by four spaces):

Merge Left Join  (cost=14135.74..14138.08 rows=1000 width=16)
  Merge Cond: (generate_report.generate_report = (date_trunc('hour'::text, f.event_happened_at)))
  ->  Sort  (cost=12.97..13.47 rows=1000 width=8)
        Sort Key: generate_report.generate_report
        ->  Function Scan on generate_report  (cost=0.00..3.00 rows=1000 width=8)
  ->  Sort  (cost=14122.77..14122.81 rows=67 width=16)
        Sort Key: (date_trunc('hour'::text, f.event_happened_at))
        ->  HashAggregate  (cost=14121.93..14122.17 rows=67 width=8)
              ->  Hash Join  (cost=3237.14..14121.86 rows=67 width=8)
                    Hash Cond: (b.foo_id = f.id)
                    ->  Index Scan using index_bars_on_thing_type_and_thing_id_and_baz on bars b  (cost=0.00..10859.88 rows=10937 width=4)
                          Index Cond: (((thing_type)::text = 'Dog'::text) AND (thing_id = 26631))
                    ->  Hash  (cost=3131.42..3131.42 rows=30207 width=12)
                          ->  Seq Scan on foos f  (cost=0.00..3131.42 rows=30207 width=12)
                                Filter: (age((('now'::text)::date)::timestamp without time zone, event_happened_at) <= '24:00:00'::interval)
share|improve this answer
    
Markdown allows by design a subset of HTML. It should have been a <pre><code>. But that's clumsy if you can just use Markdown formatting rules without throwing in some HTML yourself. –  BalusC Dec 5 '12 at 18:33
    
it's not source code. so if i use the 4-space indent, SO will incorrectly guess what language it is based on my tags, and give it meaningless colors –  John Bachir Dec 5 '12 at 18:37
1  
@John You can tell it not to; example here –  Michael Mrozek Dec 5 '12 at 18:40
    
thanks -- but i am trying to report a bug with the parser, i'm not looking for a workaround –  John Bachir Dec 5 '12 at 18:50
    
@John What are you trying to use pre behavior for? Here on SE, monospaced text on an alternate background is used for code snippets. You can't insert marquee tags and expect them to work correctly, but that isn't a bug. –  Asad Dec 5 '12 at 18:51
    
regardless of if my choice of pre is the best, AFAIK this is a bug with the parser. i thought that this was the appropriate venue for reporting bugs. –  John Bachir Dec 5 '12 at 18:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .