Hi James

I would ideally like the call to <<ytif>> to display with the same format
> as the [[No P]] Tiddler or the first video from the "ytv" Macro. Would you
> mind taking a look and seeing what i am doing wrong?
>

After quite a bit of experimentation I found the fix. It's probably a bug,
but in order for the iframe that is output by your JS macro to be
recognised as a block mode construct you need to follow it with a double
line break (ie \n\n), thus:

    var output = ["<iframe class='ytif' name='",name,"' frameborder='0'
theme=light  src='http://www.youtube.com/embed/";, code, "?start=",
start,"&theme=dark&color=red&wmode=opaque' allowfullscreen/>\n\n"];

Best wishes

Jeremy.



>
> Regards,
> James
>
> On Tuesday, 31 March 2015 20:41:18 UTC+9, Jeremy Ruston wrote:
>
>> Hi James
>>
>>>
>>>
>>> That would work but it's a bit more verbose that I would like. I guess
>>> this could be further wrapped in a plain tiddler macro? My setup is to have
>>> <<ytif>> to set up the iframe and you can pass the video code or have it
>>> come from a field value. CSS trickery seems like an easy solution if a 2nd
>>> layer of macro doesn't work, but are the <p> tags likely to change in the
>>> future?
>>>
>>
>> Ah, how are you calling the macro? If the macro call starts at the
>> beginning of a block, and is followed by two line breaks, then the macro
>> content will be parsed in block mode, otherwise in inline mode. So you can
>> force inline mode by ensuring that the macro call doesn't look like a
>> block, for instance by following it with a comment:
>>
>> <<ytif>><!-- Force inline mode -->
>>
>> Best wishes
>>
>> Jeremy
>>
>>
>>>
>>> James
>>>
>>> On Tuesday, 31 March 2015 12:26:54 UTC+1, Jeremy Ruston wrote:
>>>>
>>>> Hi James
>>>>
>>>> The <p> tags are being generated because the content returned by the JS
>>>> macro is being parsed in "block" mode, and so the parser is looking for
>>>> double line breaks to separate paragraphs.
>>>>
>>>> There are several things you may be able to do to fix this but the
>>>> easiest would be to explicitly call the JS macro with the <$macrocall>
>>>> widget and specify mode="inline". Would that work here?
>>>>
>>>> Best wishes
>>>>
>>>> Jeremy
>>>>
>>>> On Mon, Mar 30, 2015 at 11:49 PM, James Anderson <james.w....@gmail.com
>>>> > wrote:
>>>>
>>>>> I came across this today while working on some simple YT macros so I
>>>>> can link to specific times within videos on a statically exported blog.
>>>>>
>>>>> http://phasersonkill.com/2015/3/31/macro%20sample.html
>>>>>
>>>>> The first video is generated via a JS macro and the 2nd via a plain
>>>>> macro defined with a global scope. the difference in size (at least on
>>>>> Chrome and IE) is because the JS macros output is wrapped in <p> tags. I
>>>>> can probably do some CSS hacking to fix this but is there a way of 
>>>>> stopping
>>>>> the <p> tags from being generated in this case?
>>>>>
>>>>> Thanks,
>>>>> James
>>>>>
>>>>> --
>>>>> 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 tiddlywiki+...@googlegroups.com.
>>>>> To post to this group, send email to tiddl...@googlegroups.com.
>>>>> Visit this group at http://groups.google.com/group/tiddlywiki.
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Jeremy Ruston
>>>> mailto:jeremy...@gmail.com
>>>>
>>>
>>
>>
>> --
>> Jeremy Ruston
>> mailto:jeremy...@gmail.com
>>
>


-- 
Jeremy Ruston
mailto:jeremy.rus...@gmail.com

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/CAPKKYJaUiwCW1hSc-P_QHiAY9HpHNuPamR-MEh6kog8FfyRFqQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to