收藏
回答

微信通过?cgi-bin/message/mass/preview预览接口发出的文章内容会过滤css

我在使用http请求方式: POST https://api.weixin.qq.com/cgi-bin/message/mass/preview?access_token=ACCESS_TOKEN 这个接口发送预览请求时,文章内容包含一些135编辑器的css样式,微信这边会过滤掉一些css样式

https://mp.weixin.qq.com/s?__biz=Mzg3MjA0NTY1Nw==&tempkey=MTA4NV9yb2hVcmxuTlNnTVJ6cEpJSTE1WnlUUEZPRVFKSjZfczYwbU5Pajl2WGFJd0ZwMk44dm91eldLMGY2QkdFMkhlRF9YRHRpbmp0N2dvclZGdmZhYUlpV1R2QlBNcTlGSkUwUklHeFQxcUJ1Ui11RU00QlprRjVoei00c1kyWFptcWwzLVI5UXB3Qnp5amNIRFJva3NTQVhoT2NkLThrSUhfZTA4bUN3fn4%3D&chksm=cef40b2bf983823dbf62e9f1e4c709587634c5829589c5077ba4301f977d8bbd2ec5d10058fc&mpshare=1&scene=1&srcid=1028QT7pPPJRtXkceen8JpRZ&sharer_sharetime=1603875298081&sharer_shareid=3cd7b6c8abd3a86b46ea8c67f4bc8162#wechat_redirect 这个是微信预览的地址

<section class="_135editor" data-tools="135编辑器" data-id="91005">

    <section style="width:100%;" data-width="100%">

        <section>

            <section style="text-align:center; width:180px; margin-left:auto; margin-right:auto;" data-width="180px">

                <img src="https://xkycsoss.newaircloud.com/xkycs/pic/202010/28/a95d880e-e549-471f-838b-d49a9cf4ccd5.jpg" data-fail="0" style="display: inline; width: 100%; vertical-align: middle; max-width: 100%;" data-ratio="1.8896797153024911" data-w="281" data-width="100%" nac_w="281" nac_h="531"/>

            </section>

            <section style="font-size:16px;">

                <svg xml:space="default" width="100%" height="390" style="margin-top:-400px;box-sizing:border-box;transform: rotateZ(0deg);-webkit-transform: rotateZ(0deg);-moz-transform: rotateZ(0deg);-o-transform: rotateZ(0deg);" xmlns="http://www.w3.org/2000/svg">

                    <g style="width:100%;height:100px;box-sizing:border-box;opacity:0;" data-width="100%">

                        <rect width="100%" height="400" style="fill:white;box-sizing:border-box;"></rect>

                        <text x="50%" y="170" height="30" style="color: rgb(222, 125, 135); text-anchor: middle; font-size:20px;" fill="#de7d87">

                            因为穷

                        </text>

                        <animate attributename="opacity" from="0" to="1" begin="click" dur="1s" fill="freeze" style="box-sizing:border-box;" additive="sum"></animate>

                    </g>

                </svg>

            </section>

        </section>

    </section>

</section>

<section class="_135editor" data-tools="135编辑器" data-id="90016">

    <section style="width:100%;" data-width="100%">

        <section class="135bg" style="width:300px; height:605px; margin:10px auto; background-image:url(https://bdn.135editor.com/files/images/editor_styles/ef6fa56e84057c889e2254d7b2c53b63.jpg); background-repeat:no-repeat; background-size:100% auto; overflow:hidden;" data-width="300px">

            <section style="width:268px; height:490px; margin-left:15px; margin-top:73px;" class="135bg" data-width="268px">

                <svg xml:space="default" width="268" height="490" style="box-sizing: border-box;" class="barrage">

                    <text font-family="microsoft yahei" font-size="20" y="60" x="692.727" fill="#ff6767" style="box-sizing: border-box;">

                        <tspan class="135brush" data-brushtype="text" style="box-sizing: border-box;">

                            糊了糊了

                        </tspan>

                        <animate attributename="x" values="800;-400" begin="0s" dur="11s" repeatcount="indefinite" style="box-sizing: border-box;"></animate>

                    </text>

                    <text font-family="microsoft yahei" font-size="15" y="75" x="657.712" fill="#fb929e" style="box-sizing: border-box;">

                        <tspan class="135brush" data-brushtype="text" style="box-sizing: border-box;">

                            排版就用135

                        </tspan>

                        <animate attributename="x" values="800;-400" begin="1s" dur="10.8s" repeatcount="indefinite" style="box-sizing: border-box;"></animate>

                    </text>

                    <text font-family="microsoft yahei" font-size="17" y="100" x="786.001" fill="#61b292" style="box-sizing: border-box;">

                        <tspan class="135brush" data-brushtype="text" style="box-sizing: border-box;">

                            我一拳过去你可能会

                        </tspan>

                        <animate attributename="x" values="800;-400" begin="2.5s" dur="10s" repeatcount="indefinite" style="box-sizing: border-box;"></animate>

                    </text>

                    <text font-family="microsoft yahei" font-size="13" y="120" x="-393.777" fill="#ffd615" style="box-sizing: border-box;">

                        <tspan class="135brush" data-brushtype="text" style="box-sizing: border-box;">

                            吃一个冰激凌吧

                        </tspan>

                        <animate attributename="x" values="800;-400" begin="3s" dur="10.3s" repeatcount="indefinite" style="box-sizing: border-box;"></animate>

                    </text>

                    <text font-family="microsoft yahei" font-size="15" y="140" x="767.31" fill="#e0ffcd" style="box-sizing: border-box;">

                        <tspan class="135brush" data-brushtype="text" style="box-sizing: border-box;">

                            你也网上冲浪啊

                        </tspan>

                        <animate attributename="x" values="800;-400" begin="2s" dur="10.3s" repeatcount="indefinite" style="box-sizing: border-box;"></animate>

                    </text>

                    <text font-family="microsoft yahei" font-size="18" y="150" x="325.827" fill="#f8b3eb" style="box-sizing: border-box;">

                        <tspan class="135brush" data-brushtype="text" style="box-sizing: border-box;">

                            愿您开心每一天

                        </tspan>

                        <animate attributename="x" values="800;-400" begin="4s" dur="11s" repeatcount="indefinite" style="box-sizing: border-box;"></animate>

                    </text>

                    <text font-family="microsoft yahei" font-size="14" y="180" x="583.392" fill="#f7c482" style="box-sizing: border-box;">

                        <tspan class="135brush" data-brushtype="text" style="box-sizing: border-box;">

                            135太好用啦

                        </tspan>

                        <animate attributename="x" values="800;-400" begin="5s" dur="13s" repeatcount="indefinite" style="box-sizing: border-box;"></animate>

                    </text>

                    <text font-family="microsoft yahei" font-size="18" y="200" x="65.3414" fill="#f9499e" style="box-sizing: border-box;">

                        <tspan class="135brush" data-brushtype="text" style="box-sizing: border-box;">

                            等一个众筹

                        </tspan>

                        <animate attributename="x" values="800;-400" begin="6s" dur="12s" repeatcount="indefinite" style="box-sizing: border-box;"></animate>

                    </text>

                    <text font-family="microsoft yahei" font-size="22" y="200" x="165.341" fill="#9951ff" style="box-sizing: border-box;">

                        <tspan class="135brush" data-brushtype="text" style="box-sizing: border-box;">

                            你也用啊

                        </tspan>

                        <animate attributename="x" values="800;-400" begin="7s" dur="12s" repeatcount="indefinite" style="box-sizing: border-box;"></animate>

                    </text>

                    <text font-family="microsoft yahei" font-size="14" y="240" x="692.273" fill="#fff9d4" style="box-sizing: border-box;">

                        <tspan class="135brush" data-brushtype="text" style="box-sizing: border-box;">

                            厉害啊!!

                        </tspan>

                        <animate attributename="x" values="800;-400" begin="9s" dur="15s" repeatcount="indefinite" style="box-sizing: border-box;"></animate>

                    </text>

                </svg>

            </section>

        </section>

    </section>

</section>

<section class="_135editor" data-tools="135编辑器" data-id="85620">

    <section style="border: 0px; box-sizing: border-box; width: 100%; clear: both;padding: 0px; display: inline-block;margin-top: 5px;" data-width="100%">

        <section class="layout" style="box-sizing: border-box; width: 20%; float:left; padding: 0px 0.5em 0px 0px; text-align: left;line-height: 1.5em;" data-width="20%">

            <section style="text-align: left;  float: left; font-weight: 100; color: inherit; border-color: rgb(239, 112, 96);">

                <section style="float:right;display: inline-block;">

                    <p style=" clear: none; float: right; display: inline; width: 20px; color: inherit; font-weight: inherit; text-decoration: inherit; border-color: rgb(239, 112, 96);margin-top: 20px;" data-width="20px">

                        <span class="135brush" data-brushtype="text" style="font-size:25px">所以留白。</span>

                    </p>

                    <p style="margin-right: 15px; clear: none; float: right; display: inline; width: 20px; color: inherit; font-weight: inherit; text-decoration: inherit; border-color: rgb(239, 112, 96);" data-width="20px">

                        <span class="135brush" data-brushtype="text" style="font-size:25px">格调干净,</span>

                    </p>

                </section>

            </section>

        </section>

        <section class="layout" style="display: inline-block; width: 80%; box-sizing: border-box; float: right; padding: 0px 0px 0px 1em; text-align: left;" data-width="80%">

            <section class="135brush" data-style="box-sizing: border-box; margin-right: 0.1em; padding: 3px 5px; color: rgb(120, 124, 129);font-size:16px;line-height: 1em; text-align: left;">

                <p style="text-align:left;box-sizing: border-box; margin-right: 0.2em; padding: 3px 5px; color: rgb(120, 124, 129); line-height: 1.5em;font-size: 16px;">

                    <span style="font-size:16px">一篇再好的文章如果没有足够的留白,瞟一眼黑鸦鸦的一坨文字立刻会让我失去阅读的兴趣,充分的留白能够让眼球有休息的时间,要知道阅读是一个注意力持续的过程,人的眼球会停的扫描文字,如果没有很明显的空行留白眼球会一直扫描下去,时间一长就会非常的疲倦。而留有空行就能轻松的识别两个段落,简短的休息后继续扫描下一段。</span>

                </p>

            </section>

        </section>

    </section>

</section>

<p>

    <br/>

</p>

这个是我们这边的原有的样式,请问微信这边是会过滤哪些样式


回答关注问题邀请回答
收藏

1 个回答

  • 刘军
    刘军
    2020-10-28

    这个我们这边的样式

    、、

    这个是预览出去的样式

    2020-10-28
    有用
    回复
登录 后发表内容