-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes a few markup things in the HTML output and adds a new feature f…
…or Small Caps.
- Loading branch information
Showing
5 changed files
with
47 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
/** | ||
* Kirby Semantic Markup Plugin | ||
* | ||
* @version 1.0.0 | ||
* @version 1.0.1 | ||
* @author Scott Boms <[email protected]> | ||
* @copyright Scott Boms <[email protected]> | ||
* @link https://github.com/scottboms/kirby-markup | ||
|
@@ -30,9 +30,9 @@ | |
$html .= '<abbr>' . $abbr . '</abbr>'; | ||
} elseif($title !== '' && $class == '') { | ||
// title provided but no class | ||
$html .= '<abbr title=">' . $title . '">' . $abbr . '</abbr>'; | ||
$html .= '<abbr title="' . $title . '">' . $abbr . '</abbr>'; | ||
} else { | ||
$html .= '<abbr title=">' . $title . '" class="' . $class . '">' . $abbr . '</abbr>'; | ||
$html .= '<abbr title="' . $title . '" class="' . $class . '">' . $abbr . '</abbr>'; | ||
} | ||
return $html; | ||
}, | ||
|
@@ -75,9 +75,9 @@ | |
$html .= '<dfn>' . $dfn . '</dfn>'; | ||
} elseif($title !== '' && $class == '') { | ||
// title provided but no class | ||
$html .= '<dfn title=">' . $title . '">' . $dfn . '</dfn>'; | ||
$html .= '<dfn title="' . $title . '">' . $dfn . '</dfn>'; | ||
} else { | ||
$html .= '<dfn title=">' . $title . '" class="' . $class . '">' . $dfn . '</dfn>'; | ||
$html .= '<dfn title="' . $title . '" class="' . $class . '">' . $dfn . '</dfn>'; | ||
} | ||
return $html; | ||
} | ||
|
@@ -97,7 +97,7 @@ | |
// if no class attributes | ||
$html .= '<ins>' . $ins . '</ins>'; | ||
} else { | ||
$html .= '<ins class=">' . $class . '">' . $ins . '</ins>'; | ||
$html .= '<ins class="' . $class . '">' . $ins . '</ins>'; | ||
} | ||
return $html; | ||
} | ||
|
@@ -117,7 +117,7 @@ | |
// if no class attributes | ||
$html .= '<mark>' . $mark . '</mark>'; | ||
} else { | ||
$html .= '<mark class=">' . $class . '">' . $mark . '</mark>'; | ||
$html .= '<mark class="' . $class . '">' . $mark . '</mark>'; | ||
} | ||
return $html; | ||
} | ||
|
@@ -137,7 +137,7 @@ | |
// if no class attributes | ||
$html .= '<q>' . $q . '</q>'; | ||
} else { | ||
$html .= '<q class=">' . $class . '">' . $q . '</q>'; | ||
$html .= '<q class="' . $class . '">' . $q . '</q>'; | ||
} | ||
return $html; | ||
} | ||
|
@@ -157,7 +157,27 @@ | |
// if no class attributes | ||
$html .= '<samp>' . $samp . '</samp>'; | ||
} else { | ||
$html .= '<samp class=">' . $class . '">' . $samp . '</samp>'; | ||
$html .= '<samp class="' . $class . '">' . $samp . '</samp>'; | ||
} | ||
return $html; | ||
} | ||
], | ||
|
||
// Small Caps | ||
'smallcaps' => [ | ||
'attr' => [ | ||
'class' | ||
], | ||
'html' => function($tag) { | ||
$html = ''; | ||
$smallcaps = $tag->smallcaps; | ||
$class = $tag->class; | ||
|
||
if($class == '') { | ||
// if no class attributes | ||
$html .= '<span class="markup__smallcaps">' . $smallcaps . '</span>'; | ||
} else { | ||
$html .= '<span class="' . $class . '">' . $smallcaps . '</span>'; | ||
} | ||
return $html; | ||
} | ||
|
@@ -177,7 +197,7 @@ | |
// if no class attributes | ||
$html .= '<s>' . $s . '</s>'; | ||
} else { | ||
$html .= '<s class=">' . $class . '">' . $s . '</s>'; | ||
$html .= '<s class="' . $class . '">' . $s . '</s>'; | ||
} | ||
return $html; | ||
} | ||
|
@@ -197,7 +217,7 @@ | |
// if no class attributes | ||
$html .= '<sub>' . $sub . '</sub>'; | ||
} else { | ||
$html .= '<sub class=">' . $class . '">' . $sub . '</sub>'; | ||
$html .= '<sub class="' . $class . '">' . $sub . '</sub>'; | ||
} | ||
return $html; | ||
} | ||
|
@@ -217,7 +237,7 @@ | |
// if no class attributes | ||
$html .= '<sup>' . $sup . '</sup>'; | ||
} else { | ||
$html .= '<sup class=">' . $class . '">' . $sup . '</sup>'; | ||
$html .= '<sup class="' . $class . '">' . $sup . '</sup>'; | ||
} | ||
return $html; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
"name": "kirby-markup", | ||
"description": "Custom Kirbytags providing more advanced semantic markup in textareas", | ||
"author": "Scott Boms <[email protected]>", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"type": "kirby-plugin", | ||
"license": "MIT" | ||
} |