Hi

Perhaps a new utility function that can be called everywhere a field gets 
created -- along the lines of this:

exports.addField = function(tiddler,name,value) {
 var trimmedName = name.toLowerCase().trim();
 if(!$tw.utils.isValidFieldName(trimmedName)) {
 if(!hadInvalidFieldName) {
 alert($tw.language.getString(
 "InvalidFieldName",
 {variables:
 {fieldName: trimmedName}
 }
 ));
 hadInvalidFieldName = true;
 return;
 }
 } else {
 if(!value && tiddler) {
 value = tiddler.fields[trimmedName];
 }
 addition[trimmedName] = value || "";
 }
 return;
};

regards

On Tuesday, 29 December 2015 11:14:52 UTC+2, PMario wrote:
>
> On Sunday, December 20, 2015 at 12:38:14 PM UTC+1, Tobias Beer wrote:
>>
>> *@Jeremy*, When and Why are we forcing field-names to be lowercase?
>>
>
> see details at: https://github.com/Jermolene/TiddlyWiki5/issues/2155
>  - 
> https://github.com/Jermolene/TiddlyWiki5/issues/2155#issuecomment-167578296
>  - 
> https://github.com/Jermolene/TiddlyWiki5/issues/2155#issuecomment-167590321
>
> It's an implementation detail, as Jeremy shows here: 
> https://youtu.be/FDV5ojcCLB8?t=1253
>
> It is possible to change, and it may change in the future, but imo it 
> won't be an easy change. So we shouldn't expect it in the near future. 
>
>  
>
>> Also, if we are forcing fields to be all-lowercase,
>> then *tiddler.getFieldsString* must always turn a requested field to 
>> lowercase first! => ticket?
>>
>
> If you request a change in the TW core API, I think, you should raise a 
> new ticket. ... since the above one is a "question ticket"
>
> -mario
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/7ae11d49-f75b-4eb9-b82d-ef7d69f04f96%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to