-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
Probably a bug. Did some experiments to understand why in some cases the backing class JavaScript file associated with a Markdown file was not picked up, and I've found a strange behaviour. If the path of the file (be it a parent folder, or the file itself) contains an underscore (_) then the JS file is ignored.
To test this I have forked this repo, and simply added a bunch of test files (direct copies of the custom-button.js + custom-button.md demo files) and checked what happened in different cases.
You can test yourself using this branch in my fork: https://github.com/didoo/field-guide-testing/tree/backing-class-path-underscore-bug/docs
Here's what I've found:
With a simple file name and a parent folder that doesn't contain an underscore - It works ✅
- markdown file:
test-file.md - javascript file:
test-file.js - parent folder:
01-testing-normal-folder
Same file but with an underscore in the name - It doesn't work ❌
- markdown file:
test-file_with_underscore.md - javascript file:
test-file_with_underscore.js - parent folder:
01-testing-normal-folder
Same file with a 0x-- prefix - It works ✅
- markdown file:
01--test-file-with-number-prefix.md - javascript file:
01--test-file-with-number-prefix.js - parent folder:
01-testing-normal-folder
Same file with a 0x_ prefix in both the Markdown and the JS files - It doesn't work ❌
- markdown file:
02_test-file-with-number-prefix-and-underscore.md - javascript file:
02_test-file-with-number-prefix-and-underscore.js - parent folder:
01-testing-normal-folder
Same file with a 0x_ prefix in the Markdown, but a normal dash in the JS file - Strangely, it works 🤔
- markdown file:
03_test-file-with-number-prefix-and-mixed.md - javascript file:
03-test-file-with-number-prefix-and-mixed.js - parent folder:
01-testing-normal-folder
Same file with a parent folder that contains an underscore - It doesn't work ❌
- markdown file:
test-file.md - javascript file:
test-file.js - parent folder:
02_testing-folder_with_underscore
Metadata
Metadata
Assignees
Labels
No labels






