Coder Social home page Coder Social logo

Comments (4)

pmario avatar pmario commented on June 8, 2024

@Jermolene -- I had to change the OP text a little bit because I did confuse "convert to JSON" with "convert to .txt and txt.meta" rules

from tiddlywiki5.

Jermolene avatar Jermolene commented on June 8, 2024

Hi @pmario the discussion at #7799 is about the filesystemadaptor saving .tid files. It is not affected by the use of script tags with the new JSON store area.

from tiddlywiki5.

pmario avatar pmario commented on June 8, 2024

I know. But the main reason for changing .tid files to .JSON files was the problem of the "save and reload" round-trip using HTML attributes to store field-names. Now since we do not have the old-store mechanism anymore, there is no need to ever transit from .tid file to .json except if there are multi-line values in fields.

My request is to remove the automatic transition from .tid to .json, just because the filed-name contains invalid characters.

from tiddlywiki5.

Jermolene avatar Jermolene commented on June 8, 2024

Hi @pmario again, this is nothing to do with round-tripping fields to HTML attributes. There is entirely separate code to check for tiddlers that cannot be saved in a .tid file:

var hasUnsafeFields = false;
$tw.utils.each(tiddler.getFieldStrings(),function(value,fieldName) {
if(fieldName !== "text") {
hasUnsafeFields = hasUnsafeFields || /[\x00-\x1F]/mg.test(value);
hasUnsafeFields = hasUnsafeFields || ($tw.utils.trim(value) !== value);
}
hasUnsafeFields = hasUnsafeFields || /:|#/mg.test(fieldName);
});

As you can see, the conditions that trigger not being able to use a .tid file are:

  • Any field name includes a control character from 0x00 to 0x1f
  • Any field name starts or ends with whitespace
  • Any field name includes the characters : or #

from tiddlywiki5.

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.