详细说明: - 添加了V2版本的工作流页面和结果页面 - 更新了Serena记忆文件 - 添加了详细实施计划文档 - 优化了Vite配置 - 更新了项目文档CLAUDE.md - 构建了演示系统的dist版本 - 包含了exhibition-demo的完整依赖
31 lines
705 B
JavaScript
31 lines
705 B
JavaScript
/**
|
||
* @import {Break, Parents} from 'mdast'
|
||
* @import {Info, State} from 'mdast-util-to-markdown'
|
||
*/
|
||
|
||
import {patternInScope} from '../util/pattern-in-scope.js'
|
||
|
||
/**
|
||
* @param {Break} _
|
||
* @param {Parents | undefined} _1
|
||
* @param {State} state
|
||
* @param {Info} info
|
||
* @returns {string}
|
||
*/
|
||
export function hardBreak(_, _1, state, info) {
|
||
let index = -1
|
||
|
||
while (++index < state.unsafe.length) {
|
||
// If we can’t put eols in this construct (setext headings, tables), use a
|
||
// space instead.
|
||
if (
|
||
state.unsafe[index].character === '\n' &&
|
||
patternInScope(state.stack, state.unsafe[index])
|
||
) {
|
||
return /[ \t]/.test(info.before) ? '' : ' '
|
||
}
|
||
}
|
||
|
||
return '\\\n'
|
||
}
|