-
Notifications
You must be signed in to change notification settings - Fork 311
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'susimail-markdown' into 'master'
Susimail: Add markdown js for plain text content See merge request i2p-hackers/i2p.i2p!161
- Loading branch information
Showing
7 changed files
with
1,696 additions
and
0 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
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* @license http://www.gnu.org/licenses/gpl-2.0.html GPL-2.0 */ | ||
/* see also licenses/LICENSE-GPLv2.txt */ | ||
|
||
function initMarkdown() { | ||
var mailbodies = document.getElementsByClassName("mailbody"); | ||
for(index = 0; index < mailbodies.length; index++) | ||
{ | ||
var mailbody = mailbodies[index]; | ||
if (mailbody.nodeName === "P") { | ||
var converter = new Markdown.Converter(); | ||
mailbody.innerHTML = converter.makeHtml(mailbody.innerHTML); | ||
} | ||
} | ||
} | ||
|
||
document.addEventListener("DOMContentLoaded", function() { | ||
initMarkdown(); | ||
}, true); | ||
|
||
/* @license-end */ |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
blockquote { | ||
border-left: 2px dotted #888; | ||
padding-left: 5px; | ||
background: #d0f0ff; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
blockquote { | ||
border-left: 2px dotted #888; | ||
padding-left: 5px; | ||
background: #d0f0ff; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
A javascript port of Markdown, as used on Stack Overflow | ||
and the rest of Stack Exchange network. | ||
|
||
Largely based on showdown.js by John Fraser (Attacklab). | ||
|
||
Original Markdown Copyright (c) 2004-2005 John Gruber | ||
<http://daringfireball.net/projects/markdown/> | ||
|
||
|
||
Original Showdown code copyright (c) 2007 John Fraser | ||
|
||
Modifications and bugfixes (c) 2009 Dana Robinson | ||
Modifications and bugfixes (c) 2009-2014 Stack Exchange Inc. | ||
|
||
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. | ||
|