[PR #777] [MERGED] fix(markdown-code-block-lang-mode): Fix accessing element of mimes and ext when they are undefined. #889

Closed
opened 2026-03-03 00:23:39 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/BoostIO/BoostNote-App/pull/777
Author: @theKastle
Created: 2/8/2021
Status: Merged
Merged: 2/24/2021
Merged by: @Rokt33r

Base: masterHead: fix-undefined-code-mirror-language-mimes-ext


📝 Commits (1)

  • 52139af fix(markdown-code-block-lang-mode): Fix accessing element of mimes and ext when they are undefined

📊 Changes

1 file changed (+2 additions, -2 deletions)

View changed files

📝 src/components/atoms/MarkdownPreviewer.tsx (+2 -2)

📄 Description

…d ext when they are undefined.

When code block is set in dockerfile language mode, properties mimes and ext are undefined so I add optional chaining when accessing their element.

screen-shot-mode-info-obj
cannot-read-property-0-of-undefined


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/BoostIO/BoostNote-App/pull/777 **Author:** [@theKastle](https://github.com/theKastle) **Created:** 2/8/2021 **Status:** ✅ Merged **Merged:** 2/24/2021 **Merged by:** [@Rokt33r](https://github.com/Rokt33r) **Base:** `master` ← **Head:** `fix-undefined-code-mirror-language-mimes-ext` --- ### 📝 Commits (1) - [`52139af`](https://github.com/BoostIO/BoostNote-App/commit/52139af6597e84bc25be68f1e865f06a1692fd94) fix(markdown-code-block-lang-mode): Fix accessing element of mimes and ext when they are undefined ### 📊 Changes **1 file changed** (+2 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `src/components/atoms/MarkdownPreviewer.tsx` (+2 -2) </details> ### 📄 Description …d ext when they are undefined. When code block is set in `dockerfile` language mode, properties `mimes` and `ext` are undefined so I add optional chaining when accessing their element. ![screen-shot-mode-info-obj](https://user-images.githubusercontent.com/23638151/107223942-62f03b80-6a49-11eb-9a21-1fc0e98d8f62.png) ![cannot-read-property-0-of-undefined](https://user-images.githubusercontent.com/23638151/107223967-697eb300-6a49-11eb-9688-e3a4761107f0.png) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-03 00:23:39 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/BoostNote-App#889
No description provided.