Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
applyHtmlMacros function applying macros twice
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Clint Checketts  
View profile  
 More options Aug 14 2006, 11:50 pm
From: "Clint Checketts" <checke...@gmail.com>
Date: Mon, 14 Aug 2006 22:50:43 -0500
Local: Mon, Aug 14 2006 11:50 pm
Subject: applyHtmlMacros function applying macros twice

In trying to find a good way to re-use templates I've stumbled upon a great
solution. It essentially re-uses the inserted content's template inside the
parent tiddler. This makes for simple templates (since they can be re-used).

However it uncovers a bug/feature in the applyHtmlMacros function. The
function works by starting at a root element and looking for all children
with a 'macro' attribute and executing the corresponding macro. The problem
is that when the inserted templates are included the applyHtmlMacros
functions covers them and they insert their content (that is the expected
behavior) but then the containing tiddler calls it again triggering the
macros again but in the context of the parent tiddler (this is incorrect
behavior)

To fix this the applyHtmlMacros function just needs to call

 e.removeAttribute("macro");

after the getAttribute call. That way it cleans up after itself and removes
the macro calls. There are other solutions, I've included this one here:
http://checkettsweb.com/tw/beta.html#ShowQuotes

I think this would be a great inclusion in the core (regarding the
applyHtmlMacro tweak, not necessarily the showQuotes macro there)

-Clint


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Simon Baird  
View profile  
 More options Aug 15 2006, 12:18 am
From: "Simon Baird" <simon.ba...@gmail.com>
Date: Tue, 15 Aug 2006 14:18:20 +1000
Local: Tues, Aug 15 2006 12:18 am
Subject: Re: applyHtmlMacros function applying macros twice

Agree.

On 8/15/06, Clint Checketts <checke...@gmail.com> wrote:

--
Simon Baird <simon.ba...@gmail.com>

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jeremy Ruston  
View profile  
 More options Aug 16 2006, 9:45 am
From: "Jeremy Ruston" <jeremy.rus...@gmail.com>
Date: Wed, 16 Aug 2006 14:45:19 +0100
Local: Wed, Aug 16 2006 9:45 am
Subject: Re: Re: applyHtmlMacros function applying macros twice
I've created a ticket for this issue:

http://trac.tiddlywiki.org/tiddlywiki/ticket/138

Cheers

Jeremy

On 8/15/06, Simon Baird <simon.ba...@gmail.com> wrote:

--
Jeremy Ruston
mailto:jer...@osmosoft.com
http://www.tiddlywiki.com

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »