优化codemarkd组件样式;优化scroll组件;修复sandbox组件的依赖

master
yutent 2023-04-21 17:31:40 +08:00
parent 0dab86987a
commit f3a8723b03
5 changed files with 6 additions and 9 deletions

View File

@ -23,6 +23,7 @@ class Code extends Component {
position: relative;
width: 100%;
margin: 10px 0;
padding-bottom: 6px;
border-radius: 3px;
background: #f7f8fb;
color: var(--color-dark-1);

View File

@ -205,8 +205,6 @@ class Tool {
var isTable = false // 是否表格
var emptyLineLength = 0 //连续空行的数量
// console.log(lines)
for (let it of lines) {
let tmp = it.trim()
@ -275,7 +273,7 @@ class Tool {
list.push('</tbody></table>')
continue
}
if (list.length === 0 || (!isCodeBlock && emptyLineLength > 0)) {
if (list.length === 0 || (!isCodeBlock && emptyLineLength > 1)) {
continue
}
emptyLineLength++
@ -531,8 +529,8 @@ class Tool {
// 引用结束
if (isBlockquote) {
isBlockquote = false
if (emptyLineLength > 1) {
isBlockquote = false
emptyLineLength = 0
while (blockquoteLevel > 0) {
blockquoteLevel--

View File

@ -12,7 +12,7 @@ import '../form/checkbox.js'
class Markd extends Component {
static props = {
code: ''
code: { type: String, default: '', attribute: false }
}
static styles = css`

View File

@ -174,10 +174,10 @@ class Sandbox extends Component {
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="/dist/css/reset-basic.css">
<link rel="stylesheet" href="//jscdn.ink/@bd/ui/latest/css/reset-basic.css">
<style>${this.#cache.css.code}</style>
<style>body {padding:32px;}</style>
<script type="importmap">{"imports":{"es.shim":"//jscdn.ink/es.shim/2.1.1/index.js","vue":"//jscdn.ink/vue/3.2.47/vue.esm-browser.prod.js","vue-router":"//jscdn.ink/@bytedo/vue-router/4.1.6/vue-router.js","fetch":"//jscdn.ink/@bytedo/fetch/2.1.5/next.js","@bd/core":"//jscdn.ink/@bd/core/1.9.0/index.js"}}</script>
<script type="importmap">{"imports":{"es.shim":"//jscdn.ink/es.shim/latest/index.js","vue":"//jscdn.ink/vue/3.2.47/vue.esm-browser.prod.js","vue-router":"//jscdn.ink/@bytedo/vue-router/4.1.6/vue-router.js","fetch":"//jscdn.ink/@bytedo/fetch/latest/next.js","@bd/core":"//jscdn.ink/@bd/core/latest/index.js"}}</script>
<script type="module">${this.#cache.javascript.code}</script>
</head>
<body>

View File

@ -18,8 +18,6 @@ class Scroll extends Component {
:host {
position: relative;
display: block;
width: 100%;
height: 100%;
.container {
overflow: hidden;