So siehts ganz gut aus !

This commit is contained in:
2019-04-03 17:44:16 +02:00
parent 3695b33c83
commit 0fe884c90a
6758 changed files with 530485 additions and 65 deletions

66
node_modules/pug-lexer/History.md generated vendored Normal file
View File

@@ -0,0 +1,66 @@
2.3.0 / 2016-09-11
==================
* Update is-expression to 3.0.0
2.2.2 / 2016-09-07
==================
* Support non-standard class names that start with two hyphens in class
literals, most notably used in Bemto
2.2.1 / 2016-08-29
==================
* Fix semantics of `isExpression` plugin
2.2.0 / 2016-08-26
==================
* Allow customizing `isExpression`
2.1.0 / 2016-08-22
==================
* Allow attributes that start with a colon
2.0.3 / 2016-08-07
==================
* Allow `when` expressions with colons
* Fix incorrect location of some errors
2.0.2 / 2016-06-02
==================
* Fix incorrect location of some invalid expressions in an attribute.
2.0.1 / 2016-05-31
==================
* Update README for `filename` option
2.0.0 / 2016-05-14
==================
* Take the `filename` as an option rather than special casing it. This means that lex only takes 2 arguments rather than 3
* Add support for an inline comment after a block. This means block names can no longer contain `//`
* Add type checking on arguments
1.2.0 / 2016-05-14
==================
* Throw a more helpful error if someone attempts to use the old `- each foo in bar` syntax (it should not have the `- ` prefix)
* Add Error reporting for invalid case expressions
1.0.1 / 2016-04-18
==================
* Update dependencies
- Update to `is-expression@2` which allows ES2015-style template strings
by default.
1.0.0 / 2015-12-23
==================
* First stable release

19
node_modules/pug-lexer/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,19 @@
Copyright (c) 2014 Forbes Lindesay
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

72
node_modules/pug-lexer/README.md generated vendored Normal file
View File

@@ -0,0 +1,72 @@
# pug-lexer
The pug lexer. This module is responsible for taking a string and converting it into an array of tokens.
[![Build Status](https://img.shields.io/travis/pugjs/pug-lexer/master.svg)](https://travis-ci.org/pugjs/pug-lexer)
[![Dependency Status](https://img.shields.io/david/pugjs/pug-lexer.svg)](https://david-dm.org/pugjs/pug-lexer)
[![NPM version](https://img.shields.io/npm/v/pug-lexer.svg)](https://www.npmjs.org/package/pug-lexer)
[![Coverage Status](https://img.shields.io/codecov/c/github/pugjs/pug-lexer.svg)](https://codecov.io/gh/pugjs/pug-lexer)
## Installation
npm install pug-lexer
## Usage
```js
var lex = require('pug-lexer');
```
### `lex(str, options)`
Convert Pug string to an array of tokens.
`options` can contain the following properties:
- `filename` (string): The name of the Pug file; it is used in error handling if provided.
- `plugins` (array): An array of plugins, in the order they should be applied.
```js
console.log(JSON.stringify(lex('div(data-foo="bar")', {filename: 'my-file.pug'}), null, ' '))
```
```json
[
{
"type": "tag",
"line": 1,
"val": "div",
"selfClosing": false
},
{
"type": "attrs",
"line": 1,
"attrs": [
{
"name": "data-foo",
"val": "\"bar\"",
"escaped": true
}
]
},
{
"type": "eos",
"line": 1
}
]
```
### `new lex.Lexer(str, options)`
Constructor for a Lexer class. This is not meant to be used directly unless you know what you are doing.
`options` may contain the following properties:
- `filename` (string): The name of the Pug file; it is used in error handling if provided.
- `interpolated` (boolean): if the Lexer is created as a child lexer for inline tag interpolation (e.g. `#[p Hello]`). Defaults to `false`.
- `startingLine` (integer): the real line number of the first line in the input. It is also used for inline tag interpolation. Defaults to `1`.
- `plugins` (array): An array of plugins, in the order they should be applied.
## License
MIT

1516
node_modules/pug-lexer/index.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

53
node_modules/pug-lexer/package.json generated vendored Normal file
View File

@@ -0,0 +1,53 @@
{
"_from": "pug-lexer@^4.0.0",
"_id": "pug-lexer@4.0.0",
"_inBundle": false,
"_integrity": "sha1-IQwYRX7y4XYCQnQMXmR715TOwng=",
"_location": "/pug-lexer",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "pug-lexer@^4.0.0",
"name": "pug-lexer",
"escapedName": "pug-lexer",
"rawSpec": "^4.0.0",
"saveSpec": null,
"fetchSpec": "^4.0.0"
},
"_requiredBy": [
"/pug"
],
"_resolved": "https://registry.npmjs.org/pug-lexer/-/pug-lexer-4.0.0.tgz",
"_shasum": "210c18457ef2e1760242740c5e647bd794cec278",
"_spec": "pug-lexer@^4.0.0",
"_where": "/Users/rxf/WebstormProjects/laufschrift/node_modules/pug",
"author": {
"name": "ForbesLindesay"
},
"bugs": {
"url": "https://github.com/pugjs/pug-lexer/issues"
},
"bundleDependencies": false,
"dependencies": {
"character-parser": "^2.1.1",
"is-expression": "^3.0.0",
"pug-error": "^1.3.2"
},
"deprecated": false,
"description": "The pug lexer (takes a string and converts it to an array of tokens)",
"devDependencies": {
"acorn": "^3.0.4"
},
"homepage": "https://github.com/pugjs/pug-lexer#readme",
"keywords": [
"pug"
],
"license": "MIT",
"name": "pug-lexer",
"repository": {
"type": "git",
"url": "git+https://github.com/pugjs/pug-lexer.git"
},
"version": "4.0.0"
}

File diff suppressed because it is too large Load Diff

3
node_modules/pug-lexer/test/cases/attr-es2015.pug generated vendored Normal file
View File

@@ -0,0 +1,3 @@
- var avatar = '219b77f9d21de75e81851b6b886057c7'
div.avatar-div(style=`background-image: url(https://www.gravatar.com/avatar/${avatar})`)

7
node_modules/pug-lexer/test/cases/attrs-data.pug generated vendored Normal file
View File

@@ -0,0 +1,7 @@
- var user = { name: 'tobi' }
foo(data-user=user)
foo(data-items=[1,2,3])
foo(data-username='tobi')
foo(data-escaped={message: "Let's rock!"})
foo(data-ampersand={message: "a quote: " this & that"})
foo(data-epoc=new Date(0))

17
node_modules/pug-lexer/test/cases/attrs.js.pug generated vendored Normal file
View File

@@ -0,0 +1,17 @@
- var id = 5
- function answer() { return 42; }
a(href='/user/' + id, class='button')
a(href = '/user/' + id, class = 'button')
meta(key='answer', value=answer())
a(class = ['class1', 'class2'])
a.tag-class(class = ['class1', 'class2'])
a(href='/user/' + id class='button')
a(href = '/user/' + id class = 'button')
meta(key='answer' value=answer())
a(class = ['class1', 'class2'])
a.tag-class(class = ['class1', 'class2'])
div(id=id)&attributes({foo: 'bar'})
- var bar = null
div(foo=null bar=bar)&attributes({baz: 'baz'})

43
node_modules/pug-lexer/test/cases/attrs.pug generated vendored Normal file
View File

@@ -0,0 +1,43 @@
a(href='/contact') contact
a(href='/save').button save
a(foo, bar, baz)
a(foo='foo, bar, baz', bar=1)
a(foo='((foo))', bar= (1) ? 1 : 0 )
select
option(value='foo', selected) Foo
option(selected, value='bar') Bar
a(foo="class:")
input(pattern='\\S+')
a(href='/contact') contact
a(href='/save').button save
a(foo bar baz)
a(foo='foo, bar, baz' bar=1)
a(foo='((foo))' bar= (1) ? 1 : 0 )
select
option(value='foo' selected) Foo
option(selected value='bar') Bar
a(foo="class:")
input(pattern='\\S+')
foo(terse="true")
foo(date=new Date(0))
foo(abc
,def)
foo(abc,
def)
foo(abc,
def)
foo(abc
,def)
foo(abc
def)
foo(abc
def)
- var attrs = {foo: 'bar', bar: '<baz>'}
div&attributes(attrs)
a(foo='foo' "bar"="bar")
a(foo='foo' 'bar'='bar')

View File

@@ -0,0 +1,3 @@
script(type='text/x-template')
div(id!='user-<%= user.id %>')
h1 <%= user.title %>

3
node_modules/pug-lexer/test/cases/basic.pug generated vendored Normal file
View File

@@ -0,0 +1,3 @@
html
body
h1 Title

8
node_modules/pug-lexer/test/cases/blanks.pug generated vendored Normal file
View File

@@ -0,0 +1,8 @@
ul
li foo
li bar
li baz

12
node_modules/pug-lexer/test/cases/block-code.pug generated vendored Normal file
View File

@@ -0,0 +1,12 @@
-
list = ["uno", "dos", "tres",
"cuatro", "cinco", "seis"];
//- Without a block, the element is accepted and no code is generated
-
each item in list
-
string = item.charAt(0)
.toUpperCase() +
item.slice(1);
li= string

View File

@@ -0,0 +1,5 @@
ul
li: a(href='#') foo
li: a(href='#') bar
p baz

View File

@@ -0,0 +1,2 @@
ul
li.list-item: .foo: #bar baz

4
node_modules/pug-lexer/test/cases/blockquote.pug generated vendored Normal file
View File

@@ -0,0 +1,4 @@
figure
blockquote
| Try to define yourself by what you do, and you&#8217;ll burnout every time. You are. That is enough. I rest in that.
figcaption from @thefray at 1:43pm on May 10

View File

@@ -0,0 +1,4 @@
extends ./auxiliary/blocks-in-blocks-layout.pug
block body
h1 Page 2

19
node_modules/pug-lexer/test/cases/blocks-in-if.pug generated vendored Normal file
View File

@@ -0,0 +1,19 @@
//- see https://github.com/pugjs/pug/issues/1589
-var ajax = true
-if( ajax )
//- return only contents if ajax requests
block contents
p ajax contents
-else
//- return all html
doctype html
html
head
meta( charset='utf8' )
title sample
body
block contents
p all contetns

10
node_modules/pug-lexer/test/cases/case-blocks.pug generated vendored Normal file
View File

@@ -0,0 +1,10 @@
html
body
- var friends = 1
case friends
when 0
p you have no friends
when 1
p you have a friend
default
p you have #{friends} friends

19
node_modules/pug-lexer/test/cases/case.pug generated vendored Normal file
View File

@@ -0,0 +1,19 @@
html
body
- var friends = 1
case friends
when 0: p you have no friends
when 1: p you have a friend
default: p you have #{friends} friends
- var friends = 0
case friends
when 0
when 1
p you have very few friends
default
p you have #{friends} friends
- var friend = 'Tim:G'
case friend
when 'Tim:G': p Friend is a string
when {tim: 'g'}: p Friend is an object

3
node_modules/pug-lexer/test/cases/classes-empty.pug generated vendored Normal file
View File

@@ -0,0 +1,3 @@
a(class='')
a(class=null)
a(class=undefined)

14
node_modules/pug-lexer/test/cases/classes.pug generated vendored Normal file
View File

@@ -0,0 +1,14 @@
a(class=['foo', 'bar', 'baz'])
a.foo(class='bar').baz
a.foo-bar_baz
a(class={foo: true, bar: false, baz: true})
a.-foo
a.3foo

View File

@@ -0,0 +1,43 @@
- if (true)
p foo
- else
p bar
- if (true) {
p foo
- } else {
p bar
- }
if true
p foo
p bar
p baz
else
p bar
unless true
p foo
else
p bar
if 'nested'
if 'works'
p yay
//- allow empty blocks
if false
else
.bar
if true
.bar
else
.bing
if false
.bing
else if false
.bar
else
.foo

2
node_modules/pug-lexer/test/cases/code.escape.pug generated vendored Normal file
View File

@@ -0,0 +1,2 @@
p= '<script>'
p!= '<script>'

35
node_modules/pug-lexer/test/cases/code.iteration.pug generated vendored Normal file
View File

@@ -0,0 +1,35 @@
- var items = [1,2,3]
ul
- items.forEach(function(item){
li= item
- })
- var items = [1,2,3]
ul
for item, i in items
li(class='item-' + i)= item
ul
each item, i in items
li= item
ul
each $item in items
li= $item
- var nums = [1, 2, 3]
- var letters = ['a', 'b', 'c']
ul
for l in letters
for n in nums
li #{n}: #{l}
- var count = 1
- var counter = function() { return [count++, count++, count++] }
ul
for n in counter()
li #{n}

10
node_modules/pug-lexer/test/cases/code.pug generated vendored Normal file
View File

@@ -0,0 +1,10 @@
p= null
p= undefined
p= ''
p= 0
p= false
p(foo=null)
p(foo=undefined)
p(foo='')
p(foo=0)
p(foo=false)

10
node_modules/pug-lexer/test/cases/comments-in-case.pug generated vendored Normal file
View File

@@ -0,0 +1,10 @@
doctype html
html
body
- var s = 'this'
case s
//- Comment
when 'this'
p It's this!
when 'that'
p It's that!

29
node_modules/pug-lexer/test/cases/comments.pug generated vendored Normal file
View File

@@ -0,0 +1,29 @@
// foo
ul
// bar
li one
// baz
li two
//
ul
li foo
// block
// inline follow
li three
// block
// inline followed by tags
ul
li four
//if IE lt 9
// inline
script(src='/lame.js')
// end-inline
p five
.foo // not a comment

View File

@@ -0,0 +1,9 @@
//-
s/s.
//- test/cases/comments.source.pug
//-
test/cases/comments.source.pug
when
()

1
node_modules/pug-lexer/test/cases/doctype.custom.pug generated vendored Normal file
View File

@@ -0,0 +1 @@
doctype custom stuff

View File

@@ -0,0 +1,4 @@
doctype
html
body
h1 Title

View File

@@ -0,0 +1 @@
doctype html

43
node_modules/pug-lexer/test/cases/each.else.pug generated vendored Normal file
View File

@@ -0,0 +1,43 @@
- var users = []
ul
for user in users
li= user.name
else
li no users!
- var users = [{ name: 'tobi', friends: ['loki'] }, { name: 'loki' }]
if users
ul
for user in users
li= user.name
else
li no users!
- var user = { name: 'tobi', age: 10 }
ul
each val, key in user
li #{key}: #{val}
else
li user has no details!
- var user = {}
ul
each prop, key in user
li #{key}: #{val}
else
li user has no details!
- var user = Object.create(null)
- user.name = 'tobi'
ul
each val, key in user
li #{key}: #{val}
else
li user has no details!

2
node_modules/pug-lexer/test/cases/escape-chars.pug generated vendored Normal file
View File

@@ -0,0 +1,2 @@
script.
var re = /\d+/;

8
node_modules/pug-lexer/test/cases/escape-test.pug generated vendored Normal file
View File

@@ -0,0 +1,8 @@
doctype html
html
head
title escape-test
body
textarea
- var txt = '<param name="flashvars" value="a=&quot;value_a&quot;&b=&quot;value_b&quot;&c=3"/>'
| #{txt}

View File

@@ -0,0 +1,6 @@
foo(attr="<%= bar %>")
foo(class="<%= bar %>")
foo(attr!="<%= bar %>")
foo(class!="<%= bar %>")
foo(class!="<%= bar %> lol rofl")
foo(class!="<%= bar %> lol rofl <%= lmao %>")

View File

@@ -0,0 +1 @@
include ./auxiliary/filter-in-include.pug

6
node_modules/pug-lexer/test/cases/filters-empty.pug generated vendored Normal file
View File

@@ -0,0 +1,6 @@
- var users = [{ name: 'tobi', age: 2 }]
fb:users
for user in users
fb:user(age=user.age)
:cdata

View File

@@ -0,0 +1,6 @@
script(type='text/javascript')
:coffee-script
regexp = /\n/
:coffee-script(minify=true)
math =
square: (value) -> value * value

7
node_modules/pug-lexer/test/cases/filters.custom.pug generated vendored Normal file
View File

@@ -0,0 +1,7 @@
html
body
:custom(opt='val' num=2)
Line 1
Line 2
Line 4

View File

@@ -0,0 +1,4 @@
html
body
pre
include:custom(opt='val' num=2) filters.include.custom.pug

View File

@@ -0,0 +1,7 @@
html
body
include:markdown-it some.md
script
include:coffee-script(minify=true) include-filter-coffee.coffee
script
include:cdata:coffee-script(minify=false) include-filter-coffee.coffee

1
node_modules/pug-lexer/test/cases/filters.inline.pug generated vendored Normal file
View File

@@ -0,0 +1 @@
p before #[:cdata inside] after

8
node_modules/pug-lexer/test/cases/filters.less.pug generated vendored Normal file
View File

@@ -0,0 +1,8 @@
html
head
style(type="text/css")
:less
@pad: 15px;
body {
padding: @pad;
}

View File

@@ -0,0 +1,5 @@
html
body
:markdown-it
This is _some_ awesome **markdown**
whoop.

10
node_modules/pug-lexer/test/cases/filters.nested.pug generated vendored Normal file
View File

@@ -0,0 +1,10 @@
script
:cdata:uglify-js
(function() {
console.log('test')
})()
script
:cdata:uglify-js:coffee-script
(->
console.log 'test'
)()

7
node_modules/pug-lexer/test/cases/filters.stylus.pug generated vendored Normal file
View File

@@ -0,0 +1,7 @@
html
head
style(type="text/css")
:stylus
body
padding: 50px
body

View File

@@ -0,0 +1,6 @@
html
div
:verbatim
filters are applied at compile time
with no #[b interpolation] at #{all}

13
node_modules/pug-lexer/test/cases/html.pug generated vendored Normal file
View File

@@ -0,0 +1,13 @@
- var version = 1449104952939
<ul>
<li>foo</li>
<li>bar</li>
<li>baz</li>
</ul>
<!--build:js /js/app.min.js?v=#{version}-->
<!--endbuild-->
p You can <em>embed</em> html as well.
p: <strong>Even</strong> as the body of a block expansion.

4
node_modules/pug-lexer/test/cases/html5.pug generated vendored Normal file
View File

@@ -0,0 +1,4 @@
doctype html
input(type='checkbox', checked)
input(type='checkbox', checked=true)
input(type='checkbox', checked=false)

View File

@@ -0,0 +1 @@
include /auxiliary/extends-from-root.pug

View File

@@ -0,0 +1,2 @@
include auxiliary/extends-empty-block-1.pug
include auxiliary/extends-empty-block-2.pug

View File

@@ -0,0 +1 @@
include ../cases/auxiliary/extends-relative.pug

View File

@@ -0,0 +1,3 @@
| The message is "
yield
| "

View File

@@ -0,0 +1,5 @@
html
body
p
include include-only-text-body.pug
em hello world

View File

@@ -0,0 +1,3 @@
head
script(type='text/javascript').
alert('hello world');

View File

@@ -0,0 +1,4 @@
html
include include-with-text-head.pug
script(src='/caustic.js')
script(src='/app.js')

2
node_modules/pug-lexer/test/cases/include.script.pug generated vendored Normal file
View File

@@ -0,0 +1,2 @@
script#pet-template(type='text/x-template')
include auxiliary/pet.pug

View File

@@ -0,0 +1,4 @@
include auxiliary/yield-nested.pug
p some content
p and some more

View File

@@ -0,0 +1,3 @@
pre
code
include javascript-new-lines.js

10
node_modules/pug-lexer/test/cases/includes.pug generated vendored Normal file
View File

@@ -0,0 +1,10 @@
include auxiliary/mixins.pug
+foo
body
include auxiliary/smile.html
include auxiliary/escapes.html
script(type="text/javascript")
include:verbatim auxiliary/includable.js

View File

@@ -0,0 +1,6 @@
extends auxiliary/dialog.pug
block content
h1 Alert!
p I'm an alert!

View File

@@ -0,0 +1,6 @@
html
head
block head
script(src='jquery.js')
script(src='keymaster.js')
script(src='caustic.js')

View File

@@ -0,0 +1,13 @@
extend auxiliary/layout.include.pug
block head
script(src='jquery.js')
block content
h2 Page
p Some content
block window-content
h2 Awesome
p Now we can extend included blocks!

View File

@@ -0,0 +1,4 @@
extend auxiliary/inheritance.extend.mixin.block.pug
block content
p Hello World!

View File

@@ -0,0 +1,11 @@
extend auxiliary/layout.pug
mixin article(title)
if title
h1= title
block
block content
+article("The meaning of life")
p Foo bar baz!

View File

@@ -0,0 +1,9 @@
extend auxiliary/layout.pug
block head
script(src='jquery.js')
block content
h2 Page
p Some content

View File

@@ -0,0 +1,4 @@
extends /auxiliary/inheritance.extend.recursive-parent.pug
block parent
h4 child

View File

@@ -0,0 +1,13 @@
extend auxiliary/layout.pug
block head
script(src='jquery.js')
block content
h2 Page
p Some content

9
node_modules/pug-lexer/test/cases/inheritance.pug generated vendored Normal file
View File

@@ -0,0 +1,9 @@
extends auxiliary/layout.pug
block head
script(src='jquery.js')
block content
h2 Page
p Some content

View File

@@ -0,0 +1,3 @@
block content // Main content goes here
append content // adding something to content
prepend content // adding something to other end of content

19
node_modules/pug-lexer/test/cases/inline-tag.pug generated vendored Normal file
View File

@@ -0,0 +1,19 @@
p bing #[strong foo] bong
p.
bing
#[strong foo]
#[strong= '[foo]']
#[- var foo = 'foo]']
bong
p
| bing
| #[strong foo]
| #[strong= '[foo]']
| #[- var foo = 'foo]']
| bong
p.
\#[strong escaped]
\#[#[strong escaped]

View File

@@ -0,0 +1,3 @@
p #[a.rho(href='#', class='rho--modifier') with inline link]
p Some text #[a.rho(href='#', class='rho--modifier')]
p Some text #[a.rho(href='#', class='rho--modifier') with inline link]

View File

@@ -0,0 +1,4 @@
mixin linkit(url)
a(href=url)= url
p This also works #[+linkit('http://www.bing.com')] so hurrah for Pug

View File

@@ -0,0 +1,7 @@
- var id = 42;
foo
| some
| \#{text}
| here
| My ID #{"is {" + id + "}"}

View File

@@ -0,0 +1 @@
var x = "\n here is some \n new lined text";

6
node_modules/pug-lexer/test/cases/layout.append.pug generated vendored Normal file
View File

@@ -0,0 +1,6 @@
extends ../fixtures/append/app-layout.pug
block append head
script(src='foo.js')
script(src='bar.js')

View File

@@ -0,0 +1,6 @@
extends ../fixtures/append-without-block/app-layout.pug
append head
script(src='foo.js')
script(src='bar.js')

View File

@@ -0,0 +1,19 @@
extends ../fixtures/multi-append-prepend-block/redefine.pug
append content
p.first.append Something appended to content
prepend content
p.first.prepend Something prepended to content
append content
p.last.append Last append must be most last
prepend content
p.last.prepend Last prepend must appear at top
append head
script(src='jquery.js')
prepend head
script(src='foo.js')

6
node_modules/pug-lexer/test/cases/layout.prepend.pug generated vendored Normal file
View File

@@ -0,0 +1,6 @@
extends ../fixtures/prepend/app-layout.pug
block prepend head
script(src='foo.js')
script(src='bar.js')

View File

@@ -0,0 +1,6 @@
extends ../fixtures/prepend-without-block/app-layout.pug
prepend head
script(src='foo.js')
script(src='bar.js')

View File

@@ -0,0 +1,4 @@
include ./auxiliary/mixin-at-end-of-file.pug
+slide()
p some awesome content

View File

@@ -0,0 +1,6 @@
mixin m(id)
div
block
+m()
| This text should appear

7
node_modules/pug-lexer/test/cases/mixin-hoist.pug generated vendored Normal file
View File

@@ -0,0 +1,7 @@
mixin foo()
h1= title
html
body
+foo

View File

@@ -0,0 +1,5 @@
//- regression test for https://github.com/pugjs/pug/issues/1435
include ../fixtures/mixin-include.pug
+bang

59
node_modules/pug-lexer/test/cases/mixin.attrs.pug generated vendored Normal file
View File

@@ -0,0 +1,59 @@
mixin centered(title)
div.centered(id=attributes.id)
- if (title)
h1(class=attributes.class)= title
block
- if (attributes.href)
.footer
a(href=attributes.href) Back
mixin main(title)
div.stretch
+centered(title).highlight&attributes(attributes)
block
mixin bottom
div.bottom&attributes(attributes)
block
body
+centered#First Hello World
+centered('Section 1')#Second
p Some important content.
+centered('Section 2')#Third.foo(href='menu.html', class='bar')
p Even more important content.
+main('Section 3')(href='#')
p Last content.
+bottom.foo(class='bar', name='end', id='Last', data-attr='baz')
p Some final words.
+bottom(class=['class1', 'class2'])
mixin foo
div.thing(attr1='foo', attr2='bar')&attributes(attributes)
- var val = '<biz>'
- var classes = ['foo', 'bar']
+foo(attr3='baz' data-foo=val data-bar!=val class=classes).thunk
//- Regression test for #1424
mixin work_filmstrip_item(work)
div&attributes(attributes)= work
+work_filmstrip_item('work')("data-profile"='profile', "data-creator-name"='name')
mixin my-mixin(arg1, arg2, arg3, arg4)
p= arg1
p= arg2
p= arg3
p= arg4
+foo(
attr3="qux"
class="baz"
)
+my-mixin(
'1',
'2',
'3',
'4'
)

View File

@@ -0,0 +1,24 @@
mixin article(name)
section.article
h1= name
block
html
body
+article('Foo'): p I'm article foo
mixin article(name)
section.article
h1= name
p
block
html
body
+article('Something').
I'm a much longer
text-only article,
but you can still
inline html tags
in me if you want.

44
node_modules/pug-lexer/test/cases/mixin.blocks.pug generated vendored Normal file
View File

@@ -0,0 +1,44 @@
mixin form(method, action)
form(method=method, action=action)
- var csrf_token_from_somewhere = 'hey'
input(type='hidden', name='_csrf', value=csrf_token_from_somewhere)
block
html
body
+form('GET', '/search')
input(type='text', name='query', placeholder='Search')
input(type='submit', value='Search')
html
body
+form('POST', '/search')
input(type='text', name='query', placeholder='Search')
input(type='submit', value='Search')
html
body
+form('POST', '/search')
mixin bar()
#bar
block
mixin foo()
#foo
+bar
block
+foo
p one
p two
p three
mixin baz
#baz
block
+baz()= '123'

15
node_modules/pug-lexer/test/cases/mixin.merge.pug generated vendored Normal file
View File

@@ -0,0 +1,15 @@
mixin foo
p.bar&attributes(attributes) One
p.baz.quux&attributes(attributes) Two
p&attributes(attributes) Three
p.bar&attributes(attributes)(class="baz") Four
body
+foo.hello
+foo#world
+foo.hello#world
+foo.hello.world
+foo(class="hello")
+foo.hello(class="world")
+foo
+foo&attributes({class: "hello"})

3
node_modules/pug-lexer/test/cases/mixins-unused.pug generated vendored Normal file
View File

@@ -0,0 +1,3 @@
mixin never-called
.wtf This isn't something we ever want to output
body

32
node_modules/pug-lexer/test/cases/mixins.pug generated vendored Normal file
View File

@@ -0,0 +1,32 @@
mixin comment(title, str)
.comment
h2= title
p.body= str
mixin comment (title, str)
.comment
h2= title
p.body= str
#user
h1 Tobi
.comments
+comment('This',
(('is regular, javascript')))
mixin list
ul
li foo
li bar
li baz
body
+list()
+ list()
mixin foobar(str)
div#interpolation= str + 'interpolated'
- var suffix = "bar"
+#{'foo' + suffix}('This is ')

View File

@@ -0,0 +1,6 @@
mixin list(tag, ...items)
#{tag}
each item in items
li= item
+list('ul', 1, 2, 3, 4)

2
node_modules/pug-lexer/test/cases/namespaces.pug generated vendored Normal file
View File

@@ -0,0 +1,2 @@
fb:user:role Something
foo(fb:foo='bar')

8
node_modules/pug-lexer/test/cases/nesting.pug generated vendored Normal file
View File

@@ -0,0 +1,8 @@
ul
li a
li b
li
ul
li c
li d
li e

View File

@@ -0,0 +1,4 @@
//
.foo
.bar
.hey

View File

@@ -0,0 +1,4 @@
:markdown-it
code sample
# Heading

3
node_modules/pug-lexer/test/cases/pipeless-tag.pug generated vendored Normal file
View File

@@ -0,0 +1,3 @@
pre.
what
is #{'going'} #[| #{'on'}]

10
node_modules/pug-lexer/test/cases/pre.pug generated vendored Normal file
View File

@@ -0,0 +1,10 @@
pre.
foo
bar
baz
pre
code.
foo
bar
baz

2
node_modules/pug-lexer/test/cases/quotes.pug generated vendored Normal file
View File

@@ -0,0 +1,2 @@
p "foo"
p 'foo'

Some files were not shown because too many files have changed in this diff Show More