The share button didn't include the file path, hence you couldn't correctly share the name of your Lexicon. Now you can.
+8
-4
Diff
round #0
+8
-4
website/static/js/app.js
+8
-4
website/static/js/app.js
···
610
610
if (shareParam) {
611
611
try {
612
612
const decoded = base64urlDecode(shareParam);
613
+
// Split at the first newline character
614
+
const [filePath, source] = decoded.split(/\n([\s\S]*)$/);
615
+
document.getElementById('file-path').value = filePath;
613
616
const textarea = document.getElementById('mlf-editor');
614
617
if (textarea) {
615
-
textarea.value = decoded;
616
-
updateLineNumbers(decoded);
617
-
updateHighlighting(decoded);
618
+
textarea.value = source;
619
+
updateLineNumbers(source);
620
+
updateHighlighting(source);
618
621
}
619
622
} catch (error) {
620
623
console.error('Failed to load shared code:', error);
···
624
627
}
625
628
626
629
function handleShare() {
630
+
const filePath = document.getElementById('file-path').value;
627
631
const source = getEditorContent();
628
-
const encoded = base64urlEncode(source);
632
+
const encoded = base64urlEncode(`${filePath}\n${source}`);
629
633
630
634
// Build share URL
631
635
const baseUrl = window.location.origin + window.location.pathname;
History
1 round
1 comment
vmx-atproto-dev.bsky.social
submitted
#0
1 commit
expand
collapse
Include file path when sharing
The share button didn't include the file path, hence you couldn't
correctly share the name of your Lexicon. Now you can.
no conflicts, ready to merge
This was the simplest way I could come up with. In case you care about backwards compatibility, another option would be to encode it as JSON. If it's an object, it would be the new format, if it's just a string, it's the old one.