markdown strike & underline & htbase
This commit is contained in:
parent
55e2649b03
commit
652a75c05e
9 changed files with 46 additions and 5679 deletions
|
|
@ -16,10 +16,8 @@ namespace Yavsc.Helpers
|
||||||
{
|
{
|
||||||
private const string MarkdownContentAttributeName = "markdown";
|
private const string MarkdownContentAttributeName = "markdown";
|
||||||
private const string MarkdownMarkAttributeName = "ismarkdown";
|
private const string MarkdownMarkAttributeName = "ismarkdown";
|
||||||
|
|
||||||
[HtmlAttributeName("site")]
|
[HtmlAttributeName("site")]
|
||||||
public SiteSettings Site { get; set; }
|
public SiteSettings Site { get; set; }
|
||||||
|
|
||||||
[HtmlAttributeName("base")]
|
[HtmlAttributeName("base")]
|
||||||
public string Base { get; set; }
|
public string Base { get; set; }
|
||||||
|
|
||||||
|
|
@ -107,10 +105,12 @@ namespace Yavsc.Helpers
|
||||||
|
|
||||||
var content = await GetContent(output);
|
var content = await GetContent(output);
|
||||||
var markdown = content;
|
var markdown = content;
|
||||||
var basePath = Base?.StartsWith("~") ?? false ?
|
|
||||||
Constants.UserFilesDir +
|
var htbase = Base;
|
||||||
Base.Substring(1) : Base;
|
|
||||||
var html = Markdown(markdown, basePath);
|
|
||||||
|
var html = Markdown(markdown, htbase);
|
||||||
|
|
||||||
output.Content.SetHtmlContent(html ?? "");
|
output.Content.SetHtmlContent(html ?? "");
|
||||||
}
|
}
|
||||||
private async Task<string> GetContent(TagHelperOutput output)
|
private async Task<string> GetContent(TagHelperOutput output)
|
||||||
|
|
|
||||||
|
|
@ -4,5 +4,8 @@ namespace Yavsc
|
||||||
public class ThirdPartyFiles {
|
public class ThirdPartyFiles {
|
||||||
public string DirName { get; set; }
|
public string DirName { get; set; }
|
||||||
public string Quota { get; set; }
|
public string Quota { get; set; }
|
||||||
|
public string Blog { get; set; }
|
||||||
|
public string Bills { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -29,7 +29,7 @@ namespace Yavsc
|
||||||
{
|
{
|
||||||
FileProvider = new PhysicalFileProvider(rootPath),
|
FileProvider = new PhysicalFileProvider(rootPath),
|
||||||
RequestPath = new PathString("/" + siteSettings.UserFiles.DirName),
|
RequestPath = new PathString("/" + siteSettings.UserFiles.DirName),
|
||||||
EnableDirectoryBrowsing = false
|
EnableDirectoryBrowsing = env.IsDevelopment()
|
||||||
});
|
});
|
||||||
app.UseStaticFiles();
|
app.UseStaticFiles();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,8 +30,7 @@
|
||||||
@SR["Content"]
|
@SR["Content"]
|
||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
<div markdown="@Model.Content" base="~/@Model.Id"
|
<div markdown="@Model.Content" site="SiteSettings.Value"></div>
|
||||||
site="SiteSettings.Value"></div>
|
|
||||||
</dd>
|
</dd>
|
||||||
<dt>
|
<dt>
|
||||||
@SR[Html.DisplayNameFor(model => model.Modified)]
|
@SR[Html.DisplayNameFor(model => model.Modified)]
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
@section header{
|
@section header{
|
||||||
|
|
||||||
<link href="~/css/quill.snow.css" rel="stylesheet">
|
<link href="~/css/quill.snow.css" rel="stylesheet">
|
||||||
<link href="~/css/dropzone.css" rel="stylesheet">
|
<link href="~/css/dropzone.css" rel="stylesheet">
|
||||||
|
|
||||||
|
|
@ -32,16 +33,13 @@
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@section scripts{
|
|
||||||
<script src="~/js/dropzone.js"></script>
|
<script src="~/js/dropzone.js"></script>
|
||||||
<script src="~/js/quill.js"></script>
|
<script src="~/js/quill.js"></script>
|
||||||
<script src="~/js/showdown.js"></script>
|
<script src="~/js/showdown.js"></script>
|
||||||
<script src="~/js/to-markdown.js"></script>
|
<script src="~/js/to-markdown.js"></script>
|
||||||
<script src="~/js/md-helpers.js"></script>
|
<script src="~/js/md-helpers.js"></script>
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|
||||||
var editortitre = new Quill('#Titlecnt', {
|
var editortitre = new Quill('#Titlecnt', {
|
||||||
|
|
@ -96,27 +94,30 @@ editorcontenu.on('text-change',function(delta,source){
|
||||||
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
@{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); }
|
@Html.Partial("_ValidationScriptsPartial")
|
||||||
}
|
}
|
||||||
|
|
||||||
<h2 > @SR["Blog post edition"] </h2>
|
<h2 > @SR["Blog post edition"] </h2>
|
||||||
|
|
||||||
<div id="Titletoolbar" class="hidden ql-snow ql-toolbar">
|
<div id="Titletoolbar" class="hidden ql-snow ql-toolbar">
|
||||||
<button class="ql-format-button ql-bold"></button>
|
<button class="ql-format-button ql-bold"></button>
|
||||||
<button class="ql-format-button ql-italic"></button>
|
<button class="ql-format-button ql-italic"></button>
|
||||||
|
<button class="ql-format-button ql-underline"></button>
|
||||||
<button class="ql-format-button ql-strike"></button>
|
<button class="ql-format-button ql-strike"></button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h2 id="Titlecnt"><markdown>@Model.Title</markdown></h2>
|
<h2 id="Titlecnt"><markdown>@Model.Title</markdown></h2>
|
||||||
|
|
||||||
<div id="contentbar" class="hidden ql-snow ql-toolbar">
|
<div id="contentbar" class="hidden ql-snow ql-toolbar">
|
||||||
|
<span class="ql-format-group">
|
||||||
<button class="ql-format-button ql-bold"></button>
|
<button class="ql-format-button ql-bold"></button>
|
||||||
<button class="ql-format-button ql-italic"></button>
|
<button class="ql-format-button ql-italic"></button>
|
||||||
<button class="ql-format-button ql-underline"></button>
|
<button class="ql-format-button ql-underline"></button>
|
||||||
<button class="ql-format-button ql-strike"></button>
|
<button class="ql-format-button ql-strike"></button>
|
||||||
|
<environment names="Development">
|
||||||
<span class="ql-format-group">
|
|
||||||
<button class="ql-format-button ql-image"></button>
|
|
||||||
<button class="ql-format-button ql-link"></button>
|
<button class="ql-format-button ql-link"></button>
|
||||||
|
<button class="ql-format-button ql-image"></button>
|
||||||
|
</environment>
|
||||||
</span>
|
</span>
|
||||||
<span class="ql-format-group">
|
<span class="ql-format-group">
|
||||||
<span title="List" class="ql-format-button ql-list"></span>
|
<span title="List" class="ql-format-button ql-list"></span>
|
||||||
|
|
|
||||||
|
|
@ -11,16 +11,9 @@
|
||||||
</p>
|
</p>
|
||||||
<table class="table">
|
<table class="table">
|
||||||
<tr>
|
<tr>
|
||||||
<th>
|
<th colspan="3">
|
||||||
@SR[Html.DisplayNameFor(model => model.Title)]
|
@SR[Html.DisplayNameFor(model => model.Title)]
|
||||||
</th>
|
</th>
|
||||||
<th>
|
|
||||||
@SR["Author"]
|
|
||||||
</th>
|
|
||||||
<th>
|
|
||||||
@SR["Date"]
|
|
||||||
</th>
|
|
||||||
<th></th>
|
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
@foreach (var item in Model) {
|
@foreach (var item in Model) {
|
||||||
|
|
@ -30,13 +23,10 @@
|
||||||
<markdown>@item.Title</markdown>
|
<markdown>@item.Title</markdown>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
@item.Author.UserName
|
<span style="font-size:x-small;"> @item.Author.UserName </span> <br>
|
||||||
</td>
|
<span style="font-size:xx-small;">
|
||||||
<td>
|
|
||||||
<span style="font-size:x-small;">
|
|
||||||
posté le @item.Posted.ToString("dddd d MMM yyyy à H:mm")
|
posté le @item.Posted.ToString("dddd d MMM yyyy à H:mm")
|
||||||
@if ((item.Modified - item.Posted).Minutes > 10)
|
@if ((item.Modified - item.Posted).Minutes > 10){
|
||||||
{
|
|
||||||
@:- Modifié le @item.Modified.ToString("dddd d MMM yyyy à H:mm")
|
@:- Modifié le @item.Modified.ToString("dddd d MMM yyyy à H:mm")
|
||||||
}
|
}
|
||||||
</span>
|
</span>
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@
|
||||||
"Google.Apis.Core": "1.11.1",
|
"Google.Apis.Core": "1.11.1",
|
||||||
"Google.Apis": "1.11.1",
|
"Google.Apis": "1.11.1",
|
||||||
"MailKit": "1.3.0-beta7",
|
"MailKit": "1.3.0-beta7",
|
||||||
"MarkdownDeep-av.NET": "1.5.2",
|
"MarkdownDeep-av.NET": "1.5.3",
|
||||||
"Microsoft.AspNet.Authentication.Cookies": "1.0.0-rc1-*",
|
"Microsoft.AspNet.Authentication.Cookies": "1.0.0-rc1-*",
|
||||||
"Microsoft.AspNet.Authentication.Facebook": "1.0.0-rc1-final",
|
"Microsoft.AspNet.Authentication.Facebook": "1.0.0-rc1-final",
|
||||||
"Microsoft.AspNet.Authentication.Twitter": "1.0.0-rc1-final",
|
"Microsoft.AspNet.Authentication.Twitter": "1.0.0-rc1-final",
|
||||||
|
|
@ -141,4 +141,4 @@
|
||||||
"prepublish": "gulp min",
|
"prepublish": "gulp min",
|
||||||
"postpublish": "echo \" . ./contrib/postPublish.sh # to push in prod.\""
|
"postpublish": "echo \" . ./contrib/postPublish.sh # to push in prod.\""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -407,7 +407,7 @@ module.exports = [
|
||||||
{
|
{
|
||||||
filter: 'div',
|
filter: 'div',
|
||||||
replacement: function (content) {
|
replacement: function (content) {
|
||||||
return '\n\n' + content + '\n\n';
|
return content + '\n';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -438,6 +438,13 @@ module.exports = [
|
||||||
|
|
||||||
{
|
{
|
||||||
filter: ['em', 'i'],
|
filter: ['em', 'i'],
|
||||||
|
replacement: function (content) {
|
||||||
|
return '*' + content + '*';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
filter: ['u'],
|
||||||
replacement: function (content) {
|
replacement: function (content) {
|
||||||
return '_' + content + '_';
|
return '_' + content + '_';
|
||||||
}
|
}
|
||||||
|
|
@ -451,7 +458,7 @@ module.exports = [
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
filter: ['s'],
|
filter: ['strike','s'],
|
||||||
replacement: function (content) {
|
replacement: function (content) {
|
||||||
return '~~' + content + '~~';
|
return '~~' + content + '~~';
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue