Markdown video and audio, supported at client side
* BlogsController.cs: Fixes the Markdown usage of the uploaded files: Files are now renamed by dropping invalid characters and replacing spaces by underscores. An existing destination file is removed at upload. * showdown.js: Renders audio and video at client side * to-markdown.js: converts html audio and video to Markdown * TestByteA.cs: adds a prefix, an underscore, to the test table `_testbytea` * Edit.aspx: Uses the new `showdown` javascript module (that previously was named `Showdown`) * Web.csproj: cleaning * MarkdownDeep.dll: Renders video an audio * GruntFile.js: Was pollution
This commit is contained in:
parent
77149697dd
commit
9912d0cbb2
9 changed files with 2357 additions and 432 deletions
|
|
@ -49,7 +49,7 @@ function isBlock(node) {
|
|||
|
||||
var voids = [
|
||||
'area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'input',
|
||||
'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr', 'audio',
|
||||
'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr',
|
||||
];
|
||||
|
||||
function isVoid(node) {
|
||||
|
|
@ -489,8 +489,16 @@ module.exports = [
|
|||
{
|
||||
filter: 'audio',
|
||||
replacement: function(content, node) {
|
||||
var alt = node.alt || '';
|
||||
var alt = node.getAttribute("alt") || '';
|
||||
var src = node.getAttribute('src') || '';
|
||||
if (!src)
|
||||
for (var i = 0; i < node.childNodes.length; i++)
|
||||
{
|
||||
if (node.childNodes[i].localName == 'source') {
|
||||
src = node.childNodes[i].getAttribute('src') ;
|
||||
break;
|
||||
}
|
||||
}
|
||||
var title = node.title || '';
|
||||
var titlePart = title ? ' "'+ title +'"' : '';
|
||||
return src ? '![audio:' + alt + ']' + '(' + src + titlePart + ')' : '';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue