extends ../layout

block content
  div.news-item
    include ../partials/joinsite

    .page-header
        h3
            a(href=item.html_url)= item.title
        = 'submitted '
        span.timeago(title="#{item.created_at}")= timeago(item.created_at)
        = ' by '
        a(href='/news/user/' + item.user.login, class='user')= item.user.login
        h4
          div(class="item-summary")!= item.body
    include ../partials/postcomment

    each comment, index in comments
      div.comment
        a(href='/news/user/' + comment.user.login)= comment.user.login
        span.timeago(title="#{comment.created_at}")= timeago(comment.created_at)
        blockquote.content
            != comment.body
            button.btn.btn-primary(data-toggle='modal', data-target='##{index}modal', style= 'float: right;') View MD Source
            div(style= 'clear:both;')
        div(id= index + 'modal', tabindex= "-1", role= "dialog").modal.fade
          div.modal-dialog
            div.modal-content
              div.modal-header
                button.close(data-dismiss= "modal")
                  span(aria-hidden= "true", st) &times;
                h4.modal-title
                  Comment MD Source
              div.modal-body
                textarea(readonly, style="width: 100%; height: 300px;")
                  #{comment.mdBody}

extends ../layout

block content
  div.news-item
    include ../partials/joinsite

    .page-header
        h3
            a(href=item.html_url)= item.title
        = 'submitted '
        span.timeago(title="#{item.created_at}")= timeago(item.created_at)
        = ' by '
        a(href='/news/user/' + item.user.login, class='user')= item.user.login
        h4
          div(class="item-summary")!= item.body
    include ../partials/postcomment

    each comment, index in comments
      div.comment
        a(href='/news/user/' + comment.user.login)= comment.user.login
        span.timeago(title="#{comment.created_at}")= timeago(comment.created_at)
        blockquote.content
            != comment.body
            button.btn.btn-primary(data-toggle='modal', data-target='##{index}modal', style= 'float: right;') View MD Source
            div(style= 'clear:both;')
        div(id= index + 'modal', tabindex= "-1", role= "dialog").modal.fade
          div.modal-dialog
            div.modal-content
              div.modal-header
                button.close(data-dismiss= "modal")
                  span(aria-hidden= "true", st) &times;
                h4.modal-title
                  | Comment’s Markdown Source
              div.modal-body
                textarea(readonly, style="width: 100%; height: 300px;")
                  = comment.mdBody

Fix bad markup in “View MD Source” modal
Fix bad markup in “View MD Source” modal

With the old markup, every popup contained the text twice, in opening and closing HTML tags, like this:

    <@chall8908 I really like that. That's also great for mobile devices which are inherently bad at displaying nested content inline.></@chall8908 I really like that. That's also great for mobile devices which are inherently bad at displaying nested content inline.>

This change makes the content display correctly. I also improved the modal’s title, which used to render as just “MD Source”.