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

Use <code> for inline code, <pre> for code blocks #225

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions hashover/backend/classes/markdown.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,13 @@ protected function inlineCodeReplace ($grp)
// Returns the original inline markdown code with HTML replacement
protected function inlineCodeReturn ($grp)
{
return '<code class="hashover-inline">' . $this->codeMarkers['inline']['marks'][($grp[1])] . '</code>';
return '<code>' . $this->codeMarkers['inline']['marks'][($grp[1])] . '</code>';
}

// Returns the original markdown code block with HTML replacement
protected function blockCodeReturn ($grp)
{
return '<code>' . $this->codeMarkers['block']['marks'][($grp[1])] . '</code>';
return '<pre>' . $this->codeMarkers['block']['marks'][($grp[1])] . '</pre>';
}

// Parses a string as markdown
Expand Down
4 changes: 2 additions & 2 deletions hashover/frontend/markdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ HashOverConstructor.prototype.markdown = {

// Return the original markdown code with HTML replacement
paragraphs[i] = paragraphs[i].replace (this.inlineCodeMarker, function (marker, number) {
return '<code class="hashover-inline">' + markdown.codeMarkers.inline.marks[number] + '</code>';
return '<code>' + markdown.codeMarkers.inline.marks[number] + '</code>';
});
}

Expand All @@ -89,7 +89,7 @@ HashOverConstructor.prototype.markdown = {

// Replace code block markers with original markdown code
string = string.replace (this.blockCodeMarker, function (marker, number) {
return '<code>' + markdown.codeMarkers.block.marks[number] + '</code>';
return '<pre>' + markdown.codeMarkers.block.marks[number] + '</pre>';
});

return string;
Expand Down
4 changes: 1 addition & 3 deletions hashover/themes/1.0-ported/comments.css
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,6 @@ Copyright (C) 2014-2018 Jacob Barkdull
#hashover .hashover-comment code {
width: 100%;
max-height: 200px;
display: inline-block;
overflow: auto;
border: 1px solid #C1C1C1;
background-color: #F5F5F5;
Expand All @@ -686,8 +685,7 @@ Copyright (C) 2014-2018 Jacob Barkdull
margin: 0px;
}

#hashover code.hashover-inline {
display: inline;
#hashover code {
padding: 1px 4px;
border-radius: 0px;
font-size: 12px;
Expand Down
4 changes: 1 addition & 3 deletions hashover/themes/default-borderless/comments.css
Original file line number Diff line number Diff line change
Expand Up @@ -913,7 +913,6 @@ Copyright (C) 2016-2018 Jacob Barkdull

.hashover .hashover-comment pre,
.hashover .hashover-comment code {
display: inline-block;
width: 100%;
max-height: 400px;
white-space: pre;
Expand All @@ -925,8 +924,7 @@ Copyright (C) 2016-2018 Jacob Barkdull
overflow: auto;
}

.hashover code.hashover-inline {
display: inline;
.hashover code {
padding: 1px 4px;
}

Expand Down
4 changes: 1 addition & 3 deletions hashover/themes/default/comments.css
Original file line number Diff line number Diff line change
Expand Up @@ -873,7 +873,6 @@ Copyright (C) 2016-2018 Jacob Barkdull

.hashover .hashover-comment pre,
.hashover .hashover-comment code {
display: inline-block;
width: 100%;
max-height: 400px;
white-space: pre;
Expand All @@ -885,8 +884,7 @@ Copyright (C) 2016-2018 Jacob Barkdull
overflow: auto;
}

.hashover code.hashover-inline {
display: inline;
.hashover code {
padding: 1px 4px;
}

Expand Down