Skip to content

Commit

Permalink
Merge pull request #1 from albyp/master
Browse files Browse the repository at this point in the history
Added h2/h3 functions
  • Loading branch information
bijx authored Nov 16, 2023
2 parents e625d40 + adb574c commit f347df2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@

<div class="buttons">
<button data-tag="h1">H1<span class="tooltip">Ctrl + Shift + H</span></button>
<button data-tag="h2">H2</button>
<button data-tag="h3">H3</button>
<button data-tag="b">B<span class="tooltip">Ctrl + B</span></button>
<button data-tag="u">U<span class="tooltip">Ctrl + U</span></button>
<button data-tag="i">I<span class="tooltip">Ctrl + I</span></button>
Expand Down
2 changes: 2 additions & 0 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ function updatePreview() {

content = content.replace(/\n/g, '<br>');
content = content.replace(/\[h1\](.*?)\[\/h1\]/g, '<h1>$1</h1>');
content = content.replace(/\[h2\](.*?)\[\/h2\]/g, '<h2>$1</h2>');
content = content.replace(/\[h3\](.*?)\[\/h3\]/g, '<h3>$1</h3>');
content = content.replace(/\[b\](.*?)\[\/b\]/g, '<b>$1</b>');
content = content.replace(/\[u\](.*?)\[\/u\]/g, '<u>$1</u>');
content = content.replace(/\[i\](.*?)\[\/i\]/g, '<i>$1</i>');
Expand Down
10 changes: 10 additions & 0 deletions styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,16 @@ h1 {
color: #5aa9d6;
}

h2 {
font-weight: 300;
color: #5aa9d6;
}

h3 {
font-weight: 200;
color: #5aa9d6;
}

.quote-modal {
display: none;
position: fixed;
Expand Down

0 comments on commit f347df2

Please sign in to comment.