/** Copyright © 2021 Musing Studio LLC.** This file is part of WriteFreely.** WriteFreely is free software: you can redistribute it and/or modify* it under the terms of the GNU Affero General Public License, included* in the LICENSE file in this source code package.*/package writefreelyimport "testing"func TestApplyBasicMarkdown(t *testing.T) {tests := []struct {name stringin stringresult string}{{"empty", "", ""},{"empty spaces", " ", ""},{"empty tabs", "\t", ""},{"empty newline", "\n", ""},{"nums", "123", "123"},{"dot", ".", "."},{"dash", "-", "-"},{"plain", "Hello, World!", "Hello, World!"},{"multibyte", "こんにちは", `こんにちは`},{"bold", "**안녕하세요**", `<strong>안녕하세요</strong>`},{"link", "[WriteFreely](https://writefreely.org)", `<a href="https://writefreely.org" rel="nofollow">WriteFreely</a>`},{"date", "12. April", `12. April`},{"table", "| Hi | There |", `| Hi | There |`},}for _, test := range tests {t.Run(test.name, func(t *testing.T) {res := applyBasicMarkdown([]byte(test.in))if res != test.result {t.Errorf("%s: wanted %s, got %s", test.name, test.result, res)}})}}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。