Message from discussion
Remove <p> wrappers around WYSIWYG shortcodes
Received: by 10.204.5.194 with SMTP id 2mr33838bkw.7.1349234626149;
Tue, 02 Oct 2012 20:23:46 -0700 (PDT)
X-BeenThere: silverstripe-dev@googlegroups.com
Received: by 10.204.13.17 with SMTP id z17ls1405341bkz.5.gmail; Tue, 02 Oct
2012 20:23:44 -0700 (PDT)
Received: by 10.204.148.22 with SMTP id n22mr35556bkv.0.1349234624859;
Tue, 02 Oct 2012 20:23:44 -0700 (PDT)
Received: by 10.204.148.22 with SMTP id n22mr35555bkv.0.1349234624840;
Tue, 02 Oct 2012 20:23:44 -0700 (PDT)
Return-Path: <ham...@silverstripe.com>
Received: from mail-la0-f43.google.com (mail-la0-f43.google.com [209.85.215.43])
by gmr-mx.google.com with ESMTPS id 23si268162bku.1.2012.10.02.20.23.44
(version=TLSv1/SSLv3 cipher=OTHER);
Tue, 02 Oct 2012 20:23:44 -0700 (PDT)
Received-SPF: pass (google.com: domain of ham...@silverstripe.com designates 209.85.215.43 as permitted sender) client-ip=209.85.215.43;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of ham...@silverstripe.com designates 209.85.215.43 as permitted sender) smtp.mail=ham...@silverstripe.com
Received: by lahi5 with SMTP id i5so6298900lah.16
for <silverstripe-dev@googlegroups.com>; Tue, 02 Oct 2012 20:23:44 -0700 (PDT)
d=google.com; s=20120113;
h=mime-version:in-reply-to:references:date:message-id:subject:from:to
:content-type:x-gm-message-state;
bh=AnqJ1TPvveA+6n7qbFpbuQNBbWg27x2/Jm6TziE+M3U=;
b=d6GHuoiBgIiyVqmPzf9rBjqA3oy/Xp7Q87az12N+9Xa6nkXHg1B4m0z3QYHUWN9Rgu
QueMxfwlSUEWH1XSRvY2gI7MGOPB/bFqNiOQ0Oj4tBnxZP3+GKdojrYOkj70jzVlP6ka
2zmDnOCk23ZUXwzqHd7tRTkoICRUFGedd4xF1TSp995GLkFJnVD9fP38STxqUrdq0GWW
yr1bqXZk9hlN+HONW2jInDK8Fti8rCWGiRejOhnbDZZEafSgn+AtnKDUWHUm3Ribs10W
ndx3dtoJr/O3wEHH6sfqt6+z65x2KPPrd7s4qTULEunHORDrlIDxwLaI6isU/xuzFR6J
z+cQ==
MIME-Version: 1.0
Received: by 10.152.114.3 with SMTP id jc3mr594309lab.11.1349234624235; Tue,
02 Oct 2012 20:23:44 -0700 (PDT)
Received: by 10.112.89.112 with HTTP; Tue, 2 Oct 2012 20:23:44 -0700 (PDT)
In-Reply-To: <20d25aa4-3d4c-492f-8838-96b0c140b314@googlegroups.com>
References: <f435a815-770f-48c3-a2b0-4c3bd703f6a5@googlegroups.com>
<20d25aa4-3d4c-492f-8838-96b0c140b314@googlegroups.com>
Date: Wed, 3 Oct 2012 16:23:44 +1300
Message-ID: <CAN9hyBcigLdehfy7LLbQAtFwRoOTMVSid_JhSAC=49U7Cjd...@mail.gmail.com>
Subject: Re: [silverstripe-dev] Re: Remove <p> wrappers around WYSIWYG shortcodes
From: Hamish Friedlander <ham...@silverstripe.com>
To: silverstripe-dev@googlegroups.com
Content-Type: multipart/alternative; boundary=f46d04088c7f7f083604cb1f2a77
X-Gm-Message-State: ALoCoQnGiB2XMcas1bNV3WsLhCnBhQiHupjfsBr2gRjmLn4ChcsBHFA/zuTh0+RBO/OSxtKAXgU6
--f46d04088c7f7f083604cb1f2a77
Content-Type: text/plain; charset=ISO-8859-1
Although I don't necessarily agree with Sam that the answer is just not
using shortcodes inside the WYSIWYG editor, I don't really like the "every
p tag gets swallowed magically" method - I agree with Sam that's it's
edge-case-specific magic that's likely to cause confusion.
A couple of things I think might be OK:
- Have shortcodes indicate that they swallow their containing tag. Then
when you do [swallowing_tag] it will always swallow the immediately
surrounding parent.
- Have a HTML equivalent for shortcodes, so you can do <div
data-shortcode="YouTube XXXX">....</div> which TinyMCE wouldn't surround
with <p> tags. Would probably need a plugin for TinyMCE to actually enter
via the WYSIWYG form.
Hamish Friedlander
--f46d04088c7f7f083604cb1f2a77
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Although I don't=A0necessarily=A0agree with Sam that the answer is just=
not using shortcodes inside the WYSIWYG editor, I don't really like th=
e "every p tag gets swallowed magically" method - I agree with Sa=
m that's it's edge-case-specific magic that's likely to cause c=
onfusion.<div>
<br></div><div>A couple of things I think might be OK:</div><div><br></div>=
<div>- Have shortcodes indicate that they swallow their containing tag. The=
n when you do [swallowing_tag] it will always swallow the immediately surro=
unding parent.</div>
<div><br></div><div>- Have a HTML=A0equivalent=A0for shortcodes, so you can=
do <div data-shortcode=3D"YouTube XXXX">....</div> w=
hich TinyMCE wouldn't surround with <p> tags. Would probably need=
a plugin for TinyMCE to actually enter via the WYSIWYG form.</div>
<div><br></div><div>Hamish Friedlander</div><div><br></div>
--f46d04088c7f7f083604cb1f2a77--