Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style: add *.html to prettier formatting #21

Merged
merged 1 commit into from
May 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@
<html>
<head>
<title>{{ name }} demo</title>
<link rel="stylesheet" href="./demo.css"/>
<link href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@400;700&display=swap" rel="stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta name="description" content="{{ description }}">
<meta name="keywords" content="{{ keywords }}">
<link rel="stylesheet" href="./demo.css" />
<link
href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@400;700&display=swap"
rel="stylesheet"
/>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content="{{ description }}" />
<meta name="keywords" content="{{ keywords }}" />
</head>
<body>
<nav>
Expand Down Expand Up @@ -36,7 +39,7 @@ <h2>Try it out</h2>
<form onsubmit="return parseHtml()">
<label>
<span>Base URL</span>
<input type="text" name="base-url" id="base-url"/>
<input type="text" name="base-url" id="base-url" />
</label>

<label>
Expand All @@ -58,7 +61,10 @@ <h2>Output</h2>
<div class="error">
<h1>JavaScript is disabled</h1>
<p>It looks like you have JavaScript disabled.</p>
<p>You need JavaScript to be enabled to view the demo; it's a JavaScript component!</p>
<p>
You need JavaScript to be enabled to view the demo; it's a JavaScript
component!
</p>
</div>
</noscript>
<footer>
Expand All @@ -68,4 +74,4 @@ <h1>JavaScript is disabled</h1>
</footer>
<script src="./demo.js"></script>
</body>
</html>
</html>
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"demo:build": "parcel build demo/index.html --out-dir public --public-url ./",
"build": "tsc",
"lint": "eslint --cache './**/*.{ts,js}'",
"prettier:list": "prettier '**/*.{ts,json,md}' --list-different",
"prettier:list": "prettier '**/*.{ts,json,md,html}' --list-different",
"test": "nyc mocha --require ts-node/register test/**/*.spec.ts",
"test:package": "mocha test/package.spec.js"
},
Expand Down Expand Up @@ -66,7 +66,7 @@
}
},
"lint-staged": {
"*.{js,ts,json,css,md}": "prettier --write",
"*.{js,ts,json,css,md,html}": "prettier --write",
"*.{js,ts}": "eslint --cache --fix"
},
"nyc": {
Expand Down
10 changes: 9 additions & 1 deletion test/suites/experimental/lang-feed.html
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
<!-- From: https://github.com/microformats/php-mf2/blob/87da7b37350b9e99de85d457b12117472a06024c/tests/Mf2/ParseLanguageTest.php#L122 -->
<html> <div class="h-feed" lang="en"> <h1 class="p-name">Test Feed</h1> <div class="h-entry">This test is in English.</div> <div class="h-entry" lang="es">Esta prueba está en español.</div> <div class="h-entry" lang="fr">Ce test est en français.</div> </html>

<html>
<div class="h-feed" lang="en">
<h1 class="p-name">Test Feed</h1>
<div class="h-entry">This test is in English.</div>
<div class="h-entry" lang="es">Esta prueba está en español.</div>
<div class="h-entry" lang="fr">Ce test est en français.</div>
</div>
</html>
23 changes: 18 additions & 5 deletions test/suites/experimental/lang.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,30 @@
<!-- From: https://github.com/microformats/php-mf2/blob/87da7b37350b9e99de85d457b12117472a06024c/tests/Mf2/ParseLanguageTest.php#L22 -->
<html lang="en"> <div class="h-entry">This test is in English.</div> </html>
<html lang="en">
<div class="h-entry">This test is in English.</div>
</html>

<!-- From: https://github.com/microformats/php-mf2/blob/87da7b37350b9e99de85d457b12117472a06024c/tests/Mf2/ParseLanguageTest.php#L36 -->
<html> <div class="h-entry" lang="en">This test is in English.</div> </html>
<html>
<div class="h-entry" lang="en">This test is in English.</div>
</html>

<!-- From: https://github.com/microformats/php-mf2/blob/87da7b37350b9e99de85d457b12117472a06024c/tests/Mf2/ParseLanguageTest.php#L50 -->
<html lang="en"> <div class="h-entry" lang="es">Esta prueba está en español.</div> </html>
<html lang="en">
<div class="h-entry" lang="es">Esta prueba está en español.</div>
</html>

<!-- From: https://github.com/microformats/php-mf2/blob/87da7b37350b9e99de85d457b12117472a06024c/tests/Mf2/ParseLanguageTest.php#L64 -->
<div class="h-entry" lang="en">This test is in English.</div>

<!-- From: https://github.com/microformats/php-mf2/blob/87da7b37350b9e99de85d457b12117472a06024c/tests/Mf2/ParseLanguageTest.php#L105 -->
<html lang="en"> <div class="h-entry">This test is in English.</div> <div class="h-entry" lang="es">Esta prueba está en español.</div> </html>
<html lang="en">
<div class="h-entry">This test is in English.</div>
<div class="h-entry" lang="es">Esta prueba está en español.</div>
</html>

<!-- From: https://github.com/microformats/php-mf2/blob/87da7b37350b9e99de85d457b12117472a06024c/tests/Mf2/ParseLanguageTest.php#L255 -->
<div class="h-entry" lang="sv" id="postfrag123"><h1 class="p-name">En svensk titel</h1><div class="e-content" lang="en">With an <em>english</em> summary</div><div class="e-content">Och <em>svensk</em> huvudtext</div></div>
<div class="h-entry" lang="sv" id="postfrag123">
<h1 class="p-name">En svensk titel</h1>
<div class="e-content" lang="en">With an <em>english</em> summary</div>
<div class="e-content">Och <em>svensk</em> huvudtext</div>
</div>
2 changes: 1 addition & 1 deletion test/suites/local/microformats-v1/includes.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@

<span id="org">
<span class="fn">Name</span>
</span>
</span>
5 changes: 3 additions & 2 deletions test/suites/local/microformats-v2/dates.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

<div class="h-entry">
<span class="dt-published published dt-updated updated">
<time class="value" datetime="23:24-0700">23:24</time> on <time class="value">2020-03-20</time>
<time class="value" datetime="23:24-0700">23:24</time> on
<time class="value">2020-03-20</time>
</span>
</div>
</div>
2 changes: 1 addition & 1 deletion test/suites/local/microformats-v2/dates.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{
"type": ["h-entry"],
"properties": {
"name": ["23:24 on 2020-03-20"],
"name": ["23:24 on\n 2020-03-20"],
"published": ["2020-03-20 23:24-0700"],
"updated": ["2020-03-20 23:24-0700"]
}
Expand Down
2 changes: 1 addition & 1 deletion test/suites/local/microformats-v2/empty-property.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<div class="h-entry">
<span class="p-name"></span>
</div>
</div>
6 changes: 3 additions & 3 deletions test/suites/local/microformats-v2/nested.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
</div>

<div class="h-entry">
<img class="u-photo h-card" alt="My name" src="/photo.jpg">
<img class="u-photo h-card" alt="My name" src="/photo.jpg" />
</div>

<div class="h-entry">
<img class="u-photo h-card" src="/photo.jpg">
<img class="u-photo h-card" src="/photo.jpg" />
</div>

<div class="h-entry">
<div class="u-photo h-card"></div>
</div>
</div>
4 changes: 2 additions & 2 deletions test/suites/local/microformats-v2/rel-urls.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<link rel="me" href="http://example.com">
<link rel="me" href="http://example.com" />
<a rel="me" href="http://example.com" type="text/html">My name</a>
<a rel="home" href="http://example.com">Go back home</a>
<a rel="home" href="http://example.com">Go back home</a>
4 changes: 2 additions & 2 deletions test/suites/local/microformats-v2/urls.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
</div>

<div class="h-entry">
<link class="u-url" href="http://example.com/">A link</link>
</div>
<link class="u-url" href="http://example.com/" />
</div>
2 changes: 1 addition & 1 deletion test/suites/local/microformats-v2/urls.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
{
"type": ["h-entry"],
"properties": {
"name": ["A link"],
"name": [""],
"url": ["http://example.com/"]
}
}
Expand Down