2016-10-10 9 views
0

ここに私のスリムなテンプレートです:スリム - 平文と他のノードの両方が含まれているノードを作成する方法

h5 
    span built by 
     a href='http://maxpleaner.com' maxpleaner 
     | with 
     a a href='http://github.com/maxpleaner/static' static 

私はこれが、このレンダリングに期待していた:static

maxpleanerによって建て

代わりにこれをレンダリングしています。

href = 'http://maxpleaner.com' maxpleaner | HREFと=「http://github.com/maxpleaner/static」静的

平文と子ノードを混合する方法はありますか、私は子ノードが私の平文を含むように作成する必要がありますか?

答えて

1

タグと同じ行のテキストで始める場合、Slimはネストされたブロック全体をプレーンテキストと見なします。 "ビルドバイヤー"をブロックに移動すると、あなたの望むように機能します。

h5 
    span 
    | built by 
    a href='http://maxpleaner.com' maxpleaner 
    | with 
    a href='http://github.com/maxpleaner/static' static 

ここでも空白は注意する必要があります。あなたは'の代わり|を使用し、> to your tagsを追加することを好むことがあります。

h5 
    span 
    ' built by 
    a> href='http://maxpleaner.com' maxpleaner 
    ' with 
    a href='http://github.com/maxpleaner/static' static 

あなたがembedded language like markdownを使用することができ空白の問題を回避するために、これはpのタグを追加するので、この場合には理想的ではないかもしれません。

h5: span 
    markdown: 
    built by [maxpleaner](http://maxpleaner.com) with [static](http://github.com/maxpleaner/static) 
関連する問題