Files
RedBear-OS/local/recipes/kde/kf6-syntaxhighlighting/source/autotests/folding/highlight.haml.fold
T

198 lines
6.9 KiB
Plaintext

<indentfold>%title
= @title
\= @title
%script<beginfold id='1'>{</beginfold id='1'>
"type": "text/javascript",
"src": "javascripts/script_#{2 + 7}",
"data": <beginfold id='2'>{</beginfold id='2'>
"controller": "reporter",
<endfold id='2'>}</endfold id='2'>,
<endfold id='1'>}</endfold id='1'>
%div<beginfold id='1'>{</beginfold id='1'>:id => [@item.type, @item.number], :class => [@item.type, @item.urgency]<endfold id='1'>}</endfold id='1'>
%div<beginfold id='1'>{</beginfold id='1'>:id => "#{@item.type}_#{@item.number}", :class => "#{@item.type} #{@item.urgency}"<endfold id='1'>}</endfold id='1'>
.item<beginfold id='1'>{</beginfold id='1'>:class => @item.is_empty? && "empty"<endfold id='1'>}</endfold id='1'>
%a<beginfold id='3'>(</beginfold id='3'>title=@title href=href<endfold id='3'>)</endfold id='3'> Stuff
%a<beginfold id='3'>(</beginfold id='3'>title=@title<endfold id='3'>)</endfold id='3'><beginfold id='1'>{</beginfold id='1'>:href => @link.href<endfold id='1'>}</endfold id='1'> Stuff
%a<beginfold id='1'>{</beginfold id='1'>:href=>"/posts", :data => <beginfold id='2'>{</beginfold id='2'>:author_id => 123, :category => 7<endfold id='2'>}</endfold id='2'><endfold id='1'>}</endfold id='1'> Posts By Author
.book-info<beginfold id='1'>{</beginfold id='1'>:data => <beginfold id='2'>{</beginfold id='2'>:book => <beginfold id='2'>{</beginfold id='2'>:id => 123, :genre => 'programming'<endfold id='2'>}</endfold id='2'>, :category => 7<endfold id='2'>}</endfold id='2'><endfold id='1'>}</endfold id='1'>
%div#things
%span#rice Chicken Fried
%p.beans<beginfold id='1'>{</beginfold id='1'> :food => 'true' <endfold id='1'>}</endfold id='1'> The magical fruit
%h1.class.otherclass#id La La La
%br/
%meta<beginfold id='1'>{</beginfold id='1'>'http-equiv' => 'Content-Type', :content => 'text/html'<endfold id='1'>}</endfold id='1'>/
%p<beginfold id='4'>[</beginfold id='4'>user<endfold id='4'>]</endfold id='4'><beginfold id='1'>{</beginfold id='1'>:class => 'alpha bravo'<endfold id='1'>}</endfold id='1'>
%blockquote<
%div
Foo!
%img
%img>
%img
%img
%pre><
foo
bar
%img
-# file: app/views/users/show.haml
%p
hello
%div<beginfold id='4'>[</beginfold id='4'>@user, :greeting<endfold id='4'>]</endfold id='4'>
%bar<beginfold id='4'>[</beginfold id='4'>290<endfold id='4'>]</endfold id='4'>/
Hello!
- user = User.find(1)
.foo.moo<beginfold id='1'>{</beginfold id='1'>:class => ['bar', 'alpha']<endfold id='1'>}</endfold id='1'><beginfold id='3'>(</beginfold id='3'>class='baz'<endfold id='3'>)</endfold id='3'>
!!! XML
%peanutbutterjelly
/ This is the peanutbutterjelly element
I like sandwiches!
/
%p This doesn't render...
%div
%h1 Because it's commented out!
%p
/[if IE]
%a<beginfold id='1'>{</beginfold id='1'> :href => 'http://www.mozilla.com/en-US/firefox/' <endfold id='1'>}</endfold id='1'>
%h1 Get Firefox
%p foo
-# This is a comment
%p bar
%p foo
-#
This won't be displayed
Nor will this
Nor will this.
%p bar
%p
= ['hi', 'there', 'reader!'].join " "
= "yo"
= link_to_remote "Add to cart",
:url => <beginfold id='2'>{</beginfold id='2'> :action => "add", :id => product.id <endfold id='2'>}</endfold id='2'>,
:update => <beginfold id='2'>{</beginfold id='2'> :success => "cart", :failure => "error" <endfold id='2'>}</endfold id='2'>
- foo = "hello"
- foo << " there"
- foo << " you!"
%p= foo
- links = <beginfold id='2'>{</beginfold id='2'>:home => "/",
:docs => "/docs",
:about => "/about"<endfold id='2'>}</endfold id='2'>
- (42...47).each do |i|
%p= i
%p See, I can count!
%p
- case 2
- when 1
= "1!"
- when 2
= "2?"
- when 3
= "3."
~ "Foo\n<pre>Bar\nBaz</pre>"
%p This is #{h quality} cake!
%p
Look at \\#{h word} lack of backslash: \#{foo}
And yon presence thereof: \{foo}
&= "I like cheese & crackers"
& I like #{"cheese & crackers"}
= "I feel <strong>!"
!= "I feel <strong>!"
! I feel #{"<strong>"}!
%whoo
%hoo= h( |
"I think this might get " + |
"pretty long so I should " + |
"probably make it " + |
"multiline so it doesn't " + |
"look awful.") |
%p This is short.
!!!
%html<beginfold id='1'>{</beginfold id='1'> :xmlns => "http://www.w3.org/1999/xhtml", :lang => "en", "xml:lang" => "en"<endfold id='1'>}</endfold id='1'>
%head
%title BoBlog
%meta<beginfold id='1'>{</beginfold id='1'>"http-equiv" => "Content-Type", :content => "text/html; charset=utf-8"<endfold id='1'>}</endfold id='1'>
%meta<beginfold id='3'>(</beginfold id='3'>http-equiv="Content-Type" content = "text/html; charset=utf-8" class=21 id='d3'<endfold id='3'>)</endfold id='3'>
%link<beginfold id='1'>{</beginfold id='1'>rel: 'stylesheet', href: 'main.css', type: 'text/css'<endfold id='1'>}</endfold id='1'>
:css
</indentfold> body <beginfold id='5'>{</beginfold id='5'>
font-size: 16px;
margin-top: 0px;
margin-bottom: 0px;
font-family: Arial, sans-serif;
<indentfold> <endfold id='5'>}</endfold id='5'>
</indentfold> p <beginfold id='5'>{</beginfold id='5'>
margin: 0px;
padding: 0px;
<indentfold> <endfold id='5'>}</endfold id='5'>
%body
#header
%a<beginfold id='1'>{</beginfold id='1'>
href: root_path,
name: "home"
<endfold id='1'>}</endfold id='1'>
%h1 BoBlog
%h2 Bob's Blog
#content
- @entries.each do |entry|
.entry<beginfold id='1'>{</beginfold id='1'> id: entry.id <endfold id='1'>}</endfold id='1'>
%h3.title= entry.title
%p.date
Posted on #{entry.posted.strftime("%A, %B %d, %Y")}
%p.body= entry.body
= button_to "Load more", entries_path,
class: "btn btn-primary",
method: :get,
params: <beginfold id='2'>{</beginfold id='2'> last_id: @entries.map(&:id).min <endfold id='2'>}</endfold id='2'>,
form: <beginfold id='2'>{</beginfold id='2'> data: <beginfold id='2'>{</beginfold id='2'> turbo_stream: true <endfold id='2'>}</endfold id='2'> <endfold id='2'>}</endfold id='2'>
:ruby
provide(:title, user_title(@user))
provide(:og, user_opengraph(@user))
provide(:meta, user_twitter_card(@user))
parent_layout 'user/profile'
#footer
%p
All content copyright © Bob
#filterTest
%p Just testing some more HAML filters
:coffee
window.alert "Hello from CoffeeScript #{1}"
:coffeescript
window.alert "Hello from CoffeeScript again, #{1 + 1}"
:css
</indentfold> #filterTest <beginfold id='5'>{</beginfold id='5'>
display: none;
<indentfold> <endfold id='5'>}</endfold id='5'>
:erb
For some reason <%= "ERB works too #{@abcdef}" %>.
:plain
Anything else should be treated as plain text.
This also means that the following shouldn't be highlighted:
%h1#superawesomeheading Heading 1
%div Filter test done