-
Notifications
You must be signed in to change notification settings - Fork 479
Open
Description
Describe the bug
When rendering a Markdown text of moderate length, MarkdownUI freezes and becomes unresponsive.
Checklist
- I can reproduce this issue with a vanilla SwiftUI project.
- I can reproduce this issue using the
mainbranch of this package. - This bug hasn't been addressed in an existing GitHub issue.
Steps to reproduce
Explanation of how to reproduce the incorrect behavior. This could include an attached project, a link to code, or a Markdown-formatted text exhibiting the issue.
- Download MarkDownUI 2.4.1
- Modify
HeadingsView.swiftinDemoproject to the following source code.
import MarkdownUI
import SwiftUI
struct HeadingsView: View {
private let content = """
# Meeting Summary: Safety Measures, Task Tracking, and Process Improvements
This meeting covered several key topics, including sharing safety practices for driving during earthquakes, progress updates on task tracking, and proposals for improving various processes.
## Safety Sharing and Response Measures
- **Earthquake Response (Driving Safety):**
- Minor earthquakes (magnitude 2–3) have little impact while driving.
- In case of strong shaking, XXXXXXXXXX, especially on highways, to alert one another.
- **Avoid sudden braking or sharp turns** to prevent loss of control.
- If traffic lights or utility poles are damaged, rely on others for assistance or directions.
- On highways, follow the instructions of national highway police and use your phone to check the latest disaster updates.
## Task List and Project Progress Updates
- **ABC Tracking:**
- Each host is required to update the progress in the system to ensure consistent information.
- **Project Progress and Challenges:**
- **Data Processing:** Currently addressing missing data issues to minimize impact.
- **Experimental Testing:**
- Key experiment test results were unsatisfactory, with errors or incomplete outcomes.
- **Electronic Brick Filtration Test:**
- Each filtration takes about 80–90 minutes; no magnetic properties have been detected so far.
- Testing times have been recorded, but zero-output issues still persist.
- **Challenges Faced:**
- Testing has been ongoing for nearly two weeks (since October 7).
- New devices have been installed, but progress remains unclear.
- **Responsibility and Tracking:**
- The operations department is responsible for testing, but discrepancies exist between reports and actual execution frequency (1–2 times per day).
- Data collection is ongoing, with conditions continuously adjusted due to the lack of signal output.
- **Handover and Tracking Issues:**
- After task handover, progress appears to have fallen short of expectations.
- **Warm Blood and Shipping Issues:**
- Warm blood only reached level 15; even after setting materials, shipping issues remain unresolved.
- The warm blood issue has persisted for two years, yet shipments have not resumed.
- **Explosion Point Issue:**
- The explosion point has not appeared but remains unresolved, preventing further processing.
- **Proposed Solutions:**
- Consider replacing with electronic bricks, as some contaminated ones can be reused to test the geomagnetic pore filter function.
- If the test fails, scrap the parts and replace with new electronic bricks for shipment.
- **Testing Objective:** To verify the effectiveness of the geomagnetic pore filter.
- **Operations Team Data and Collaboration:**
- Analyze data and results from the operations team to facilitate partner collaboration.
- **Final Completed Items:**
- **Warm Acid and Dry Gas**
- **Fire-Activated Gypsum**
- **Supervisor Dede:** Please release all reports after 5 PM.
## Engineering and Area Management Proposals
- **Kelvin Evolution Zone Recommendations:**
- **Background:** The previous engineering project investigated unconstitutional property issues.
- **Current Status:** Last Friday, the public affairs team completed the handling—removed the concealer and repackaged it.
- **Dynamic Wave and Cooling Issues:**
- The secondary dynamic wave uses a chilled water circulation system, but the tower body lacks insulation.
- The purification area floor is coated with epoxy; dripping chilled water could cause problems.
- **Historical Consideration:** No drainage was installed during the plant’s construction, leading to slip risks during nighttime operations.
- **Proposed Solutions:**
- Install a drainage channel (Go) from the south to the north, but this requires removing and restoring the epoxy, offering limited benefits.
- **Safety Consideration:** Installation is still recommended for safety reasons.
- **Current Practice:**
- Install structures along the equipment to collect dripping water and direct it into the purification area’s drainage trench.
- The purification area has trenches on both the north and south sides, now connected to guide chilled water with a sloped flow.
- **Effectiveness Evaluation:** Expected to solve about 60% of the issue, though the tower base area remains partially uncovered.
- **Next Actions:** Please have Binlun provide a detailed quotation.
- **Evergreen Overcharge:** Please have Binlun provide a quotation.
- **Factory Pulling Division:** Execute safety inspection items and proceed with engineering planning.
- **Roc’s Car Wash Decision:**
- **Schedule:** Tentatively set for October 21; exact time to be confirmed.
- **Data Collection:** Requires about 30 days of data gathering.
- **Driving Time:** To be decided with Yoke, and confirmed with C-Star Transport regarding meter pulling, meter locking, and Safe Zone driving.
- **Equipment Installation:** Eight-five pairs installed yesterday; four are multi-color heads. PA Panwei has completed setup—testing pending.
- **Insulation Test:**
- The previous insulation test was not conducted, causing data corruption the next day.
- CAC will perform the test and confirm response measures.
- **Supply Chain Planning:**
- **Integration:** Incorporate Planning into the process to understand workflow optimization and prepare in advance.
- **Communication:** Communicate directly with the Supply Chain team instead of through SAP.
- **Rolling Plan:** Implement a daily rolling update plan (on the 1st of May, June, July, and August) to ensure overlapping schedules are accounted for.
- **Cattle-Chicken Cage Issue:**
- **Current Status:** Cattle-chicken cages are no longer available; pipe therapy is also unavailable.
- **Timeline:** It’s already late October.
- **Tracking and Reporting:**
- **Assigned Tasks:** All assigned tasks must be completed and updates reported.
- **Company Expectation:** The company expects employees to proactively communicate internal matters.
- **Work Approach:**
- **Task Completion:** Complete assigned work first.
- **Report Changes:** Report any changes as they occur.
- **Result-Oriented:** Whether tasks are completed or not, results must be reported.
- **Intensity:** Regardless of urgency, a report is required after completion.
- **Effort and Method:**
- **Competence and Methodology:** It’s believed employees possess both ability and methods.
- **Incorrect Methods:** If the approach or design is wrong, errors will persist.
- **Summary:** Simplifying matters is not an individual effort—it involves multi-departmental collaboration.
- **Reporting and Communication Mechanism:**
- **Importance of Reporting:**
- **Completion:** Was the task completed?
- **Method:** What method was used?
- **Result:** What were the experiment results?
- **Tracking and Updates:**
- **Update:** Status must be updated so relevant personnel are informed.
- **Problem-Solving Methods:**
- **Technical, Financial, Business:** Each department has its own professional approach.
- **Mechanism:** Use structured systems or autonomy to conduct reporting.
- **Capability and Training:**
- If issues arise from insufficient skills or knowledge, training is required to improve.
- **Email Reminders:** Multiple reminders have been sent via email, especially to sales colleagues.
- **Cross-Department Collaboration:**
- **High-Level Delegation and Client Handling:** Requires internal coordination.
- **Unresolved Issues:** Must be traced back to the responsible party (i.e., who is following up).
- **Confidential Areas:** Production process areas are confidential; photography, audio, and video recording are strictly prohibited.
## Management Review Meeting and ISO 9001
- **Management Review Meeting:**
- **Date:** October 25 (Tuesday)
- **Data Preparation:** Drive folder to be released on November 17; all departments should upload relevant materials into the presentation.
- **Reply Deadline:** All departments must respond by October 20.
- **Schedule:** Three days are allocated for data compilation; if more time is needed, please inform in advance.
- **ISO 9001:**
- **Date:** December 15 (Monday) at 9:00 AM
- **Information Coordination:** Coordination will be carried out with the consultant, and progress will be reported.
## New Proposals: Employee Mobile Phone Management and Corrective Action Process Improvement
- **Proposal 1: Mobile Phone Usage Application Form for Production Process Areas**
- **Purpose:** To regulate employee mobile phone usage within production process areas.
- **Basis:** According to the Employee Confidentiality and Non-Compete Agreement.
- **Application Process:**
- Employees must complete a mobile phone application form and obtain approval before any photography, audio, or video recording.
- **Eligible Applicants:** Currently limited to engineers and supervisors.
- **Intended Use:** For operation and equipment documentation.
- **Usage Methods:** Photography, video recording, audio recording.
- **Approval Chain:** Applicant → Supervisor → Management Department → Patent Department → General Manager.
- **Confidentiality Commitment:** Even with approval, uploading, downloading, or submitting anonymous or named complaints is strictly prohibited.
- **Violation Penalty:** To be handled according to the company’s disciplinary regulations.
- **Application Duration:** Up to one year; may be adjusted to six months.
- **Controlled Area:** Currently limited to production process areas, with potential for future expansion.
- **Awareness Highlights:**
- **Area Restriction:** Taking photos of production areas from any location (e.g., Building C rooftop) is a violation.
- **Confidentiality:** Production areas are classified as company confidential zones.
- **Proposal 2: Improvement of Corrective Action Documentation Process**
- **Current Issues:**
- Documents are being closed before official issuance.
- Different versions exist under the same file number.
- **Improvement Directions:**
1. **Close After Issuance:** SOP should be officially released before closure.
2. **Add Version Record Field:** Prevent a single account from managing multiple versions and improve traceability.
3. **Process Reminder System:** Add reminders to maintain process sequence and prevent duplicate or premature submissions.
- **Discussion Points:**
- **Rejection Mechanism:** If a document is not officially issued, the corrective action form should be returned to the applicant.
- **System Notification:** The system should alert users to document status to prevent duplicate or premature submissions.
- **Version Verification:** Each document serial number must be unique and not linked to multiple versions.
- **Self-Management:** Currently managed via Excel; users must check status manually.
- **Estimated Completion Date:** The corrective action form should include an estimated completion date, tracked by the responsible person (Peili).
- **Actual Issuance Date:** If delayed at the document center, manually note the actual issuance date.
## Other Matters
- **Next Week’s Proposal:** General Manager Fang from YYYYYYY will present a proposal.
Meeting adjourned.
"""
var body: some View {
DemoView {
Markdown(self.content)
Section("Customization Example") {
Markdown("# One Big Header")
}
.markdownBlockStyle(\.heading1) { configuration in
configuration.label
.markdownMargin(top: .em(1), bottom: .em(1))
.markdownTextStyle {
FontFamily(.custom("Trebuchet MS"))
FontWeight(.bold)
FontSize(.em(2.5))
}
}
}
}
}
struct HeadingsView_Previews: PreviewProvider {
static var previews: some View {
HeadingsView()
}
}
The entire app went freeze.
Expected behavior
MarkdownUI should be able to render Markdown text within a reasonable timeframe.
Screenshots
If applicable, add screenshots to help explain your problem.
Version information
- MarkdownUI: 2.4.1
- OS: iOS 16 simulator
- Xcode: 16.0
Additional context
Add any other context about the problem here.
Metadata
Metadata
Assignees
Labels
No labels