Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Markdown handling & marked script handling

Đang mở
#181 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
javascript
Lĩnh vực
frontend, performance

Hướng nghiên cứu

Bắt đầu bằng cách xác định đường dẫn kết xuất fileData.extension === 'md', tham chiếu CDN của marked và phần kiểm soát mã nguồn/định dạng hiện có của Prettier. So sánh các tùy chọn xem Markdown được đề xuất và những thay đổi trong việc tải script; công việc được xem là hoàn tất khi đã thống nhất trải nghiệm xem mã nguồn/đã định dạng và xác nhận rằng việc xử lý Markdown không còn gây ra chi phí tải không cần thiết.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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?

Ngôn ngữ chính
JavaScript
Star
307
Fork
9
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của FormidableLabs/runpkg

Tất cả issue của FormidableLabs/runpkg

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.