Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Markdown handling & marked script handling

未关闭
#181 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
停滞
技术栈
javascript

调研方向

首先定位 fileData.extension === 'md' 的渲染路径、marked CDN 引用,以及现有的 Prettier 格式化/源代码控制。比较提议的 Markdown 查看选项和脚本加载变更;完成标准应包括就源代码/格式化视图体验达成一致,并确认 Markdown 处理不再带来不必要的加载成本。

由索引模型根据 Issue 内容生成。

描述

improvement

The way runpkg currently works, viewing a markdown (.md) file shows us the formatted version, thanks to the marked markdown parser.

Problems:

  1. Currently there's no way to view the source of a markdown file on runpkg. We just render the formatted version if fileData.extension === 'md' and there's no way to disable this.
  2. In running some lighthouse performance tests, it does seem that - although it's not the heaviest package - loading this script has a noticeable impact on performance metrics like TTI. This seems an unnecessary price to pay when it's likely that most pages viewed are not markdown.
  3. Bonus: is there a particular reason we're using jsdelivr over unpkg to serve this script? If not, it seems in the spirit of this project to move from using https://cdn.jsdelivr.net/npm/marked/marked.min.js to https://unpkg.com/[email protected]/marked.min.js or https://unpkg.com/marked/marked.min.js

Proposals:

  1. Make formatted/source view similar to what we do for prettier. My thoughts would be to a) add a checkbox to toggle formatted/source view, b) add a button similar to the prettier formatting button to format markdown, or c) change the prettier button to be a "format markdown" button when viewing markdown (the same as b, but saving space with the downside of no markdown prettification)
  2. If we tackle proposal 1, we can then defer/async the script
  3. Move to using https://unpkg.com/[email protected]/marked.min.js

Thoughts?

主要语言
JavaScript
星标
307
派生
9
PR 合并指标
30 天内没有已合并 PR

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

FormidableLabs/runpkg 的其他 Issue

查看 FormidableLabs/runpkg 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。