GithubHelp home page GithubHelp logo

Comments (16)

Moerill avatar Moerill commented on August 21, 2024 1

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.

Moerill avatar Moerill commented on August 21, 2024 1

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.

Moerill avatar Moerill commented on August 21, 2024

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.

Moerill avatar Moerill commented on August 21, 2024

Observation:
for some reason the text gets indented 7 (?) spaces when saving.

from fvtt-markdown-editor.

atomdmac avatar atomdmac commented on August 21, 2024

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.

Moerill avatar Moerill commented on August 21, 2024

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.

atomdmac avatar atomdmac commented on August 21, 2024

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.

Moerill avatar Moerill commented on August 21, 2024

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.

atomdmac avatar atomdmac commented on August 21, 2024

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.

Moerill avatar Moerill commented on August 21, 2024

Seems like i need to finally take a look at SWADE for this

from fvtt-markdown-editor.

atomdmac avatar atomdmac commented on August 21, 2024

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.

Moerill avatar Moerill commented on August 21, 2024

oh wait what is the issue with unregisterhelper? something bad?

i.. just added that to the hotfix and pushed it 😅

from fvtt-markdown-editor.

atomdmac avatar atomdmac commented on August 21, 2024

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.

Moerill avatar Moerill commented on August 21, 2024

ok perfect!
Does the original issue still persist for you? or is it solved?

from fvtt-markdown-editor.

atomdmac avatar atomdmac commented on August 21, 2024

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.

Moerill avatar Moerill commented on August 21, 2024

Perfect, thank you very much for your help there!

from fvtt-markdown-editor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.