Comments (16)
There is some more weird stuff going on there when saving item descriptions..
even when "just" saving 2 lines with regular words, some random spaces get added.
the coding style does come from the spaces getting added, since 4 spaces at the beginning of a line means code block. (learned smth new)
(Only for items in 5e. If i can fix it i'll check savage worlds)
buut.. thats enough for me for tonight, more testing tomorrow or so
from fvtt-markdown-editor.
Ok ye, i do notice its getting called twice there - but only because there are 2 cases of the editor helper getting caleld (one for advances, one for description), thus 2 calls and 2 created instances
from fvtt-markdown-editor.
Oh damn, didn't see this before putting this into the official module list.
Thanks for the very good issue report!
can reproduce it.. but.. hmpf what is happening here? :/
from fvtt-markdown-editor.
Observation:
for some reason the text gets indented 7 (?) spaces when saving.
from fvtt-markdown-editor.
FWIW, it looks like this happens cumulatively. That is, if you keep doing edit -> save -> edit -> save, the indent increases by 7 spaces each time you save.
from fvtt-markdown-editor.
I think i found the issue, but solving it will be another thing:
My testing observations are:
- Content gets saved properly (submit value looks fine, rerender value as well)
- Even in the handlebars helper the values get properly processed
- The extra indentation only happens when the handlebars editor helper is called inside of a handlebars partial
One workaround that i don't like:
Insert the content after the rendering process (e.g. in activateListeners).
Alternative solutions? i don't know....
from fvtt-markdown-editor.
One more observation: it looks like for the problematic editor instances, the editor
helper gets called twice: first with an empty string value for content
and subsequently with the previously saved value.
from fvtt-markdown-editor.
For me its only called once, strange.
I'll push a quick patch in the next half hour or so to try to adress this problem (and 1 or 2 styling issues i encountered).
please report backc if the issue st ill persists.
from fvtt-markdown-editor.
FWIW, I was able to confirm that editors rendered in top-level templates seem to work fine. I cut/pasted the editor from the SWADE character sheet's Background
tab into the top-level character-sheet.html
template and formatting stays consistent between loading/saving.
With regard to multiple calls to the editor
helper: I wonder if this is editor-instance specific. I had only tested with the Background
/Description
editor instance in the SWADE system.
from fvtt-markdown-editor.
Seems like i need to finally take a look at SWADE for this
from fvtt-markdown-editor.
Edit: Spoke too soon :( Looks like this didn't work as well as I had hoped.
I just added this code above the registerHelper
call and it seemed to fix the issue. I literally just tried this though so I'm not sure if there are other side-effects.
Handlebars.unregisterHelper('editor');
from fvtt-markdown-editor.
oh wait what is the issue with unregisterhelper? something bad?
i.. just added that to the hotfix and pushed it 😅
from fvtt-markdown-editor.
haha weird - I just pulled down and rebuilt and now it works fine 🤷♂️ Some of my debugging code may have been getting in the way or something.
from fvtt-markdown-editor.
ok perfect!
Does the original issue still persist for you? or is it solved?
from fvtt-markdown-editor.
Looks to be solved! Did a quick spot check to make sure that the journal inputs still work as expected and it looks like we're in good shape there, too. Thanks for your help! I think we can close this one. 👍
from fvtt-markdown-editor.
Perfect, thank you very much for your help there!
from fvtt-markdown-editor.
Related Issues (20)
- Settings Menu and removal of welcome screen
- General code restructuring
- Fix dropping of entity links not added at target position
- On start editing set cursor to the end of the content
- [BUG] 'close' button (to close an journal entry for example) no longer works HOT 3
- [BUG] HTML rendering is broken HOT 1
- [BUG] emojule integration not correctly autocompleting HOT 1
- [FEATURE] double click to edit
- Collection Plugin Ideas
- [FEATURE] HTML to Markdown conversion
- [Improvement] Syntax Highlighting HOT 1
- [BUG] Incompatibility with Cautious Gamemaster's Pack's notify typings feature HOT 1
- [BUG] With vim keybindings, pressing Esc hides the cursor and prevents further interaction until I click the text again
- [BUG] quick insert module call inside MEME HOT 2
- Secret Button is not working to secret the text.
- Incompatibility with Dice Tray
- [BUG] Quick Insert compatibility: Keybind check console error
- [BUG] Global "GM Settings" not applied to player clients
- [FEATURE] Compatibility with Pathfinder 1e System
- Module causes drag&drop journal links to be added as "undefined"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fvtt-markdown-editor.