diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 diff --git a/Admin/Install/db.json b/Admin/Install/db.json index 1d98c15..5f26c32 100755 --- a/Admin/Install/db.json +++ b/Admin/Install/db.json @@ -82,6 +82,11 @@ "type": "TEXT", "null": false }, + "qa_question_question_raw": { + "name": "qa_question_question_raw", + "type": "TEXT", + "null": false + }, "qa_question_created_at": { "name": "qa_question_created_at", "type": "DATETIME", @@ -156,6 +161,11 @@ "type": "TEXT", "null": false }, + "qa_answer_answer_raw": { + "name": "qa_answer_answer_raw", + "type": "TEXT", + "null": false + }, "qa_answer_created_at": { "name": "qa_answer_created_at", "type": "DATETIME", diff --git a/Controller/ApiController.php b/Controller/ApiController.php index 7d50162..9fa1e66 100755 --- a/Controller/ApiController.php +++ b/Controller/ApiController.php @@ -91,7 +91,8 @@ final class ApiController extends Controller $question = new QAQuestion(); $question->name = (string) $request->getData('title'); - $question->question = (string) $request->getData('plain'); + $question->questionRaw = (string) $request->getData('plain'); + $question->question = Markdown::parse((string) ($request->getData('plain') ?? '')); $question->setLanguage((string) $request->getData('language')); $question->setCategory(new NullQACategory((int) $request->getData('category'))); $question->setStatus((int) $request->getData('status')); @@ -185,7 +186,8 @@ final class ApiController extends Controller $mardkownParser = new Markdown(); $answer = new QAAnswer(); - $answer->answer = (string) $request->getData('plain'); + $answer->answerRaw = (string) $request->getData('plain'); + $answer->answer = Markdown::parse((string) ($request->getData('plain') ?? '')); $answer->question = new NullQAQuestion((int) $request->getData('question')); $answer->setStatus((int) $request->getData('status')); $answer->createdBy = new NullAccount($request->header->account); diff --git a/Docs/Dev/en/SUMMARY.md b/Docs/Dev/en/SUMMARY.md new file mode 100644 index 0000000..e69de29 diff --git a/Docs/Dev/en/structure.md b/Docs/Dev/en/structure.md new file mode 100644 index 0000000..e69de29 diff --git a/Models/QAAnswer.php b/Models/QAAnswer.php index 429f7bd..50a85d8 100755 --- a/Models/QAAnswer.php +++ b/Models/QAAnswer.php @@ -43,7 +43,7 @@ class QAAnswer implements \JsonSerializable * @var string * @since 1.0.0 */ - public $answer = ''; + public string $answer = ''; /** * Answer raw. @@ -51,7 +51,7 @@ class QAAnswer implements \JsonSerializable * @var string * @since 1.0.0 */ - public $answerRaw = ''; + public string $answerRaw = ''; /** * Question diff --git a/Models/QAAnswerMapper.php b/Models/QAAnswerMapper.php index 54af6e8..11223e0 100755 --- a/Models/QAAnswerMapper.php +++ b/Models/QAAnswerMapper.php @@ -35,6 +35,7 @@ final class QAAnswerMapper extends DataMapperAbstract */ protected static array $columns = [ 'qa_answer_id' => ['name' => 'qa_answer_id', 'type' => 'int', 'internal' => 'id'], + 'qa_answer_answer_raw' => ['name' => 'qa_answer_answer_raw', 'type' => 'string', 'internal' => 'answerRaw'], 'qa_answer_answer' => ['name' => 'qa_answer_answer', 'type' => 'string', 'internal' => 'answer'], 'qa_answer_question' => ['name' => 'qa_answer_question', 'type' => 'int', 'internal' => 'question'], 'qa_answer_status' => ['name' => 'qa_answer_status', 'type' => 'int', 'internal' => 'status'], diff --git a/Models/QACategoryL11n.php b/Models/QACategoryL11n.php old mode 100644 new mode 100755 diff --git a/Models/QACategoryL11nMapper.php b/Models/QACategoryL11nMapper.php old mode 100644 new mode 100755 diff --git a/Models/QAQuestionMapper.php b/Models/QAQuestionMapper.php index 183f816..84a2381 100755 --- a/Models/QAQuestionMapper.php +++ b/Models/QAQuestionMapper.php @@ -39,6 +39,7 @@ final class QAQuestionMapper extends DataMapperAbstract 'qa_question_title' => ['name' => 'qa_question_title', 'type' => 'string', 'internal' => 'name'], 'qa_question_language' => ['name' => 'qa_question_language', 'type' => 'string', 'internal' => 'language'], 'qa_question_question' => ['name' => 'qa_question_question', 'type' => 'string', 'internal' => 'question'], + 'qa_question_question_raw' => ['name' => 'qa_question_question_raw', 'type' => 'string', 'internal' => 'questionRaw'], 'qa_question_status' => ['name' => 'qa_question_status', 'type' => 'int', 'internal' => 'status'], 'qa_question_category' => ['name' => 'qa_question_category', 'type' => 'int', 'internal' => 'category'], 'qa_question_created_by' => ['name' => 'qa_question_created_by', 'type' => 'int', 'internal' => 'createdBy', 'readonly' => true], diff --git a/Theme/Backend/Lang/de.lang.php b/Theme/Backend/Lang/de.lang.php old mode 100644 new mode 100755 diff --git a/Theme/Backend/Lang/en.lang.php b/Theme/Backend/Lang/en.lang.php old mode 100644 new mode 100755 diff --git a/tests/Autoloader.php b/tests/Autoloader.php old mode 100644 new mode 100755 diff --git a/tests/Bootstrap.php b/tests/Bootstrap.php old mode 100644 new mode 100755 diff --git a/tests/phpunit_default.xml b/tests/phpunit_default.xml old mode 100644 new mode 100755