Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 7823ed5

Browse files
committed
Fix Bug
TextEncoderSettings
1 parent 65649b7 commit 7823ed5

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

‎src/NetCoreBBS/Startup.cs‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
using NetCoreBBS.Middleware;
1414
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
1515
using Microsoft.AspNetCore.Identity;
16+
using Microsoft.Extensions.WebEncoders;
17+
using System.Text.Unicode;
18+
using System.Text.Encodings.Web;
1619

1720
namespace NetCoreBBS
1821
{
@@ -55,11 +58,17 @@ public void ConfigureServices(IServiceCollection services)
5558
authBuilder.RequireClaim("Admin", "Allowed");
5659
});
5760
});
61+
//文字被编码 https://github.com/aspnet/HttpAbstractions/issues/315
62+
services.Configure<WebEncoderOptions>(options =>
63+
{
64+
options.TextEncoderSettings = new TextEncoderSettings(UnicodeRanges.All);
65+
});
5866
}
5967

6068
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
6169
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
6270
{
71+
env.ConfigureNLog("nlog.config");
6372
loggerFactory.AddNLog();
6473

6574
app.UseRequestIPMiddleware();

‎src/NetCoreBBS/Views/Topic/Index.cshtml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
@section scripts{
104104
<script>
105105
$(".markdown p").each(function () {
106-
var c = $(this).html();
106+
var c = $(this).text();
107107
$(this).html(markdown.toHTML(c));
108108
})
109109
</script>

‎src/NetCoreBBS/wwwroot/css/site.css‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,6 @@
6363
.reply .markdown{position:relative;line-height:1.8em;text-overflow:ellipsis;word-wrap:break-word;}
6464
.panel-footer{padding:6px 15px;}
6565
.pagination{margin:0px;}
66+
img {
67+
max-width:100%;height:auto;
68+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /