Problems with markdown formatting

markdown

(drogus) #1

When I’m adding a post on ember’s discourse instance, the code is formatted properly in the preview, but when the post is saved and after refresh, a formatting is broken.

Here is a code from the post:

{{#if loading}}
  List is loading
{{else}}
  display list
{{/if}}
<ul class="posts">
  {{#each post in controller}}
    <li>{{post.title}}</li>
  {{/each}}
</ul>

{{outlet}}
{{#resource "posts"}}
  <ul class="posts">
    {{#each post in controller}}
      <li>{{post.title}}</li>
    {{/each}}
  </ul>
{{/resource}}

{{outlet}}

(drogus) #2

I should probably also mention that adding extra newlines helps:


{{#if loading}}
  List is loading
{{else}}
  display list
{{/if}}


<ul class="posts">
  {{#each post in controller}}
    <li>{{post.title}}</li>
  {{/each}}
</ul>

{{outlet}}


{{#resource "posts"}}
  <ul class="posts">
    {{#each post in controller}}
      <li>{{post.title}}</li>
    {{/each}}
  </ul>
{{/resource}}

{{outlet}}


(Bill Ayakatubby) #3

I suggest indenting each line by 4 spaces, e.g.

{{#if loading}}
  List is loading
{{else}}
  display list
{{/if}}

<ul class="posts">
  {{#each post in controller}}
    <li>{{post.title}}</li>
  {{/each}}
</ul>

{{outlet}}

{{#resource "posts"}}
  <ul class="posts">
    {{#each post in controller}}
      <li>{{post.title}}</li>
    {{/each}}
  </ul>
{{/resource}}

{{outlet}}

(Sam Saffron) #4

Yes, this looks like a bug, @eviltrout ?


(Robin Ward) #5

Okay this is super confusing. I see your malformed markup, but when I edited it to change it without adding whitespace to the code blocks it worked perfectly. See the OP now!

I rolled back git code and it still works. Can you confirm it’s fixed or any way to reproduce it please? thanks!


(Jeff Atwood) #6

Is this still an issue or should this be deleted?


(drogus) #7

Testing in the new post, just to be sure:

{{#if loading}}
  List is loading
{{else}}
  display list
{{/if}}
<ul class="posts">
  {{#each post in controller}}
    <li>{{post.title}}</li>
  {{/each}}
</ul>

{{outlet}}
{{#resource "posts"}}
  <ul class="posts">
    {{#each post in controller}}
      <li>{{post.title}}</li>
    {{/each}}
  </ul>
{{/resource}}

{{outlet}}

(drogus) #8

It seems to work great!


(Jeff Atwood) #9