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 MarkdownMarkAttributeName = "ismarkdown";
|
||||
|
||||
[HtmlAttributeName("site")]
|
||||
public SiteSettings Site { get; set; }
|
||||
|
||||
[HtmlAttributeName("base")]
|
||||
public string Base { get; set; }
|
||||
|
||||
|
|
@ -107,10 +105,12 @@ namespace Yavsc.Helpers
|
|||
|
||||
var content = await GetContent(output);
|
||||
var markdown = content;
|
||||
var basePath = Base?.StartsWith("~") ?? false ?
|
||||
Constants.UserFilesDir +
|
||||
Base.Substring(1) : Base;
|
||||
var html = Markdown(markdown, basePath);
|
||||
|
||||
var htbase = Base;
|
||||
|
||||
|
||||
var html = Markdown(markdown, htbase);
|
||||
|
||||
output.Content.SetHtmlContent(html ?? "");
|
||||
}
|
||||
private async Task<string> GetContent(TagHelperOutput output)
|
||||
|
|
|
|||
|
|
@ -4,5 +4,8 @@ namespace Yavsc
|
|||
public class ThirdPartyFiles {
|
||||
public string DirName { 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),
|
||||
RequestPath = new PathString("/" + siteSettings.UserFiles.DirName),
|
||||
EnableDirectoryBrowsing = false
|
||||
EnableDirectoryBrowsing = env.IsDevelopment()
|
||||
});
|
||||
app.UseStaticFiles();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,8 +30,7 @@
|
|||
@SR["Content"]
|
||||
</dt>
|
||||
<dd>
|
||||
<div markdown="@Model.Content" base="~/@Model.Id"
|
||||
site="SiteSettings.Value"></div>
|
||||
<div markdown="@Model.Content" site="SiteSettings.Value"></div>
|
||||
</dd>
|
||||
<dt>
|
||||
@SR[Html.DisplayNameFor(model => model.Modified)]
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
}
|
||||
|
||||
@section header{
|
||||
|
||||
<link href="~/css/quill.snow.css" rel="stylesheet">
|
||||
<link href="~/css/dropzone.css" rel="stylesheet">
|
||||
|
||||
|
|
@ -32,16 +33,13 @@
|
|||
|
||||
</style>
|
||||
|
||||
|
||||
}
|
||||
|
||||
@section scripts{
|
||||
<script src="~/js/dropzone.js"></script>
|
||||
<script src="~/js/quill.js"></script>
|
||||
<script src="~/js/showdown.js"></script>
|
||||
<script src="~/js/to-markdown.js"></script>
|
||||
<script src="~/js/md-helpers.js"></script>
|
||||
<script>
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
var editortitre = new Quill('#Titlecnt', {
|
||||
|
|
@ -96,27 +94,30 @@ editorcontenu.on('text-change',function(delta,source){
|
|||
|
||||
});
|
||||
</script>
|
||||
@{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); }
|
||||
@Html.Partial("_ValidationScriptsPartial")
|
||||
}
|
||||
|
||||
<h2 > @SR["Blog post edition"] </h2>
|
||||
|
||||
<div id="Titletoolbar" class="hidden ql-snow ql-toolbar">
|
||||
<button class="ql-format-button ql-bold"></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>
|
||||
</div>
|
||||
|
||||
<h2 id="Titlecnt"><markdown>@Model.Title</markdown></h2>
|
||||
|
||||
<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-italic"></button>
|
||||
<button class="ql-format-button ql-underline"></button>
|
||||
<button class="ql-format-button ql-strike"></button>
|
||||
|
||||
<span class="ql-format-group">
|
||||
<button class="ql-format-button ql-image"></button>
|
||||
<environment names="Development">
|
||||
<button class="ql-format-button ql-link"></button>
|
||||
<button class="ql-format-button ql-image"></button>
|
||||
</environment>
|
||||
</span>
|
||||
<span class="ql-format-group">
|
||||
<span title="List" class="ql-format-button ql-list"></span>
|
||||
|
|
|
|||
|
|
@ -11,16 +11,9 @@
|
|||
</p>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>
|
||||
<th colspan="3">
|
||||
@SR[Html.DisplayNameFor(model => model.Title)]
|
||||
</th>
|
||||
<th>
|
||||
@SR["Author"]
|
||||
</th>
|
||||
<th>
|
||||
@SR["Date"]
|
||||
</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
|
||||
@foreach (var item in Model) {
|
||||
|
|
@ -30,13 +23,10 @@
|
|||
<markdown>@item.Title</markdown>
|
||||
</td>
|
||||
<td>
|
||||
@item.Author.UserName
|
||||
</td>
|
||||
<td>
|
||||
<span style="font-size:x-small;">
|
||||
<span style="font-size:x-small;"> @item.Author.UserName </span> <br>
|
||||
<span style="font-size:xx-small;">
|
||||
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")
|
||||
}
|
||||
</span>
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@
|
|||
"Google.Apis.Core": "1.11.1",
|
||||
"Google.Apis": "1.11.1",
|
||||
"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.Facebook": "1.0.0-rc1-final",
|
||||
"Microsoft.AspNet.Authentication.Twitter": "1.0.0-rc1-final",
|
||||
|
|
@ -141,4 +141,4 @@
|
|||
"prepublish": "gulp min",
|
||||
"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',
|
||||
replacement: function (content) {
|
||||
return '\n\n' + content + '\n\n';
|
||||
return content + '\n';
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
@ -438,6 +438,13 @@ module.exports = [
|
|||
|
||||
{
|
||||
filter: ['em', 'i'],
|
||||
replacement: function (content) {
|
||||
return '*' + content + '*';
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
filter: ['u'],
|
||||
replacement: function (content) {
|
||||
return '_' + content + '_';
|
||||
}
|
||||
|
|
@ -451,7 +458,7 @@ module.exports = [
|
|||
},
|
||||
|
||||
{
|
||||
filter: ['s'],
|
||||
filter: ['strike','s'],
|
||||
replacement: function (content) {
|
||||
return '~~' + content + '~~';
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue