1
0
mirror of https://github.com/byulmaru/quesdon synced 2024-11-30 15:58:01 +09:00

回答の改行をちゃんと反映

This commit is contained in:
rinsuki 2017-12-11 00:53:32 +09:00
parent f804ed5914
commit f1d2db525f
5 changed files with 7 additions and 3 deletions

View File

@ -1,5 +1,6 @@
import * as riot from "riot"
import "./tags/app.tag"
import "./style.css"
import "bootstrap/dist/css/bootstrap.min.css"
import "jquery"
(<any>window).Popper = require("popper.js")

3
src/client/style.css Normal file
View File

@ -0,0 +1,3 @@
.question-text {
white-space: pre-line;
}

View File

@ -9,7 +9,7 @@ page-question-latest
| 回答者:
a(href="/@{question.user.acct}") {question.user.name}
span.text-muted @{question.user.acct}
p.card-text {question.answer}
p.card-text.question-text {question.answer}
script.
apiFetch("/api/web/questions/latest").then(r => r.json()).then(r => {
this.questions = r

View File

@ -8,7 +8,7 @@ page-question
span(if="{!user_loaded}") 読み込み中...
a(href="/@{user.acct}",if="{user_loaded}") {user.name}
span.text-muted @{user.acct}
p {question.answer}
p.card-text.question-text {question.answer}
script.
apiFetch("/api/web/questions/"+this.opts.q_id).then(r => r.json()).then(r => {
this.question = r

View File

@ -15,7 +15,7 @@ page-user-top
.card-body
h4.card-title {question.question}
h6.card-subtitle.mb-2: a(href="/@{user.acct}/questions/{question._id}").text-muted {question.answeredAt}
p.card-text {question.answer}
p.card-text.question-text {question.answer}
loading(if="{!question_loaded}")
script.
import "../loading.tag"