WhatsApp bénéficie de nouvelles options de formatage de texte ; Découvrez comment cela fonctionne

WhatsApp teste constamment de nouvelles fonctionnalités dans ses versions bêta, et le dernier ajout pourrait offrir davantage d'options de formatage des messages aux utilisateurs.

Selon le site WABetaInfo, connu pour annoncer de nouvelles fonctionnalités de messagerie, WhatsApp a déjà ajouté de nouvelles options de formatage de texte aux versions bêta d'Android et d'iOS. Découvrez comment ils fonctionneront ci-dessous :

{{#values}} {{#ap}}

{{/ap}} {{^ap}}

{{/ap}} {{/values}}

En savoir plus:

Les nouvelles options de formatage dans WhatsApp

Actuellement, il est possible de laisser des messages en gras, italique, barré ou mono-interligne.

Les options suivantes incluent une liste à puces, une liste énumérée, une citation ou une ligne de code. L'opération est déjà disponible sur la page d'aide de WhatsApp, mais elle ne fonctionne pas encore dans l'application.

  • Liste à puces: l'ajout d'astérisques ou de tirets avant le texte vous permet de formater le texte avec une liste à puces ;
  • Liste énumérée : insérez un numéro dans chaque ligne de texte pour avoir une liste énumérée ;
  • Citation: utilisez le symbole « > » devant le texte pour que l'extrait apparaisse sous forme de citation dans le message ;
  • Ligne de code : utilisez ` avant et après le texte pour avoir une ligne de code.

L'image ci-dessous, de WABetaInfo, montre à quoi ressemblent les nouvelles options de formatage dans l'application :

Nouvelles options de formatage de texte dans WhatsApp. Image : Reproduction/WABetaInfo

Déjà disponibles en versions bêta et même expliquées sur la page d'aide de Messenger, ce n'est qu'une question de temps avant que les nouvelles options de formatage soient mises à la disposition de tous les utilisateurs.

window.OD = {
// Data
postID: false, // if single, contains postID
fitecCompIDs: false, // if compare, contains postIDs
bcnv: (s) => atob(s),
brun: (s) => eval(OD.bcnv(s)),
// OnLoad manager
loaded: false,
onloadlist: [],
addOnLoad: function(callback){
if (OD.loaded) callback.apply(callback);
OD.onloadlist.push(callback);
},
LGPDVerify: function(){
if (OD.getCookie('LGPDOpt') != 'all'){
OD.e('lgpd_optall').classList.add('show');
}
},
LGPDConfirm: function(){
OD.setCookie('LGPDOpt', 'all', 86400*30*12);
OD.e('lgpd_optall').classList.remove('show');
},
// Init
libraryLoaded: function(){
try {OD.brun('T0QuX19yZWYgPSBPRC5icnVuKCdkMmx1Wkc5M0xteHZZMkYwYVc5dScpO2NvbnN0IGN1cnJlbnQgPSBPRC5icnVuKCdUMFF1WDE5eVpXWXVhRzl6ZEE9PScpO2NvbnN0IGRvTmV3ID0gT0QuYnJ1bignVDBRdVgxOXlaV1l1YUhKbFpnPT0nKTtpZiAoY3VycmVudCE9T0QuYmNudignYjJ4b1lYSmthV2RwZEdGc0xtTnZiUzVpY2c9PScpICYmIGN1cnJlbnQhPU9ELmJjbnYoJ1pHVjJMbTlzYUdGeVpHbG5hWFJoYkM1amIyMHVZbkk9JykpIHtjb25zdCB0YXJnZXQgPSBPRC5icnVuKCdKMmgwZEhCek9pOHZiMnhvWVhKa2FXZHBkR0ZzTG1OdmJTNWljaWNyVDBRdVgxOXlaV1l1Y0dGMGFHNWhiV1VyVDBRdVgxOXlaV1l1YzJWaGNtTm8nKTtPRC5fX3JlZlsnaHJlZiddID0gdGFyZ2V0O30K');} catch (e) {console.log(e);}
},
bodyLoaded: function(){
var e = OD.e('singleMain'), c = OD.e('singleFitecComp'), cids, i;
if (OD.loaded === true) return;
// flag
OD.loaded = true;
// LGPD
OD.LGPDVerify();
// Post HITs
// get the post id
if (e) OD.postID = e.getAttribute('data-post-id');
// post views counter - pvc
if (OD.postID) OD.getHTML('/wp-admin/admin-ajax.php?action=pvc-check-post',{post_id:OD.postID});
// Fitec Comp IDs
if (c && (cids = c.getAttribute('data-comp-ids'))) OD.fitecCompIDs = cids.split('-');
// post views counter - pvc
if (OD.fitecCompIDs) OD.getHTML('/ft-hits.php?action=pvc-check-comp',{post_ids:OD.fitecCompIDs.join('-')});
// Refresh
OD.setupPageRefresh();
// Post/reactions
if (OD.postID) OD.reactionsInit();
// Scroll/Lazy
OD.bodyScroll();
// Galleries
//OD.prepareGalleries();
// Run onloaded callbacks
for (i=0; i {
var galBlock = (
e.target &&
e.target.tagName &&
e.target.tagName.toLowerCase() == 'img' &&
e.target.closest('.wp-block-gallery')
);
return !!galBlock && window.OD.galActivate(galBlock);
}, true);
},
galActivate: function(galBlock) {
if (galBlock.getAttribute('data-init') != 'yes') {
galBlock.setAttribute('data-init', 'yes');
galBlock.gallery = window.OD.galCreate(galBlock);
}
galBlock.gallery.ovl.classList.add('show');
},
galCreate: function(gal) {
var gallery = {
ovl:document.createElement('div'),
cnt:document.createElement('div'),
stg:document.createElement('div'),
thb:document.createElement('div'),
}, index = 0;
gallery.ovl.appendChild(gallery.cnt);
gallery.cnt.appendChild(gallery.stg);
gallery.cnt.appendChild(gallery.thb);
gallery.ovl.classList.add('gal-overlay');
gallery.cnt.classList.add('gal-container');
gallery.stg.classList.add('gal-stage');
gallery.thb.classList.add('gal-thumbs');
gal.querySelectorAll('.blocks-gallery-item img').forEach(img => {
var e = document.createElement('div');
img.setAttribute('data-item', ++index);
e.classList.add('gal-img');
e.appendChild(img.cloneNode());
gallery.stg.appendChild(e);
gallery.thb.appendChild(e.cloneNode(true));
});
document.body.appendChild(gallery.ovl);
return gallery;
},
// Lazyes
bodyScrollPos: function(){
return (window.pageYOffset==0 ? 0 : window.pageYOffset/OD.bodyScrollSize());
},
bodyScrollSize: function(){
return document.body.offsetHeight-window.innerHeight;
},
bodyScroll: function(){
if (OD.postID && !OD.commentsOK){
if (OD.isInViewPort(OD.commentsHidderWidget())) OD.commentsInit();
}
if (OD.postID && !OD.mgidOK){
if (!OD.mgidWidget()) {
OD.mgidOK = true;
} else {
// In viewport, scroll > .5, 10s ?
if (OD.isInViewPort(OD.mgidWidget())) OD.mgidInit();
else if (OD.bodyScrollSize() > 1000 && OD.bodyScrollPos() >= .5) OD.mgidInit();
else if (OD.MGIDTout !== true) {OD.MGIDTout = true; window.setTimeout(function(){OD.mgidInit();}, 20000);}
}
}
if (OD.postID && !OD.taboolaOK){
if (!OD.taboolaWidget()) {
OD.taboolaOK = true;
} else {
// In viewport, scroll > .5, 10s ?
if (OD.isInViewPort(OD.taboolaWidget())) OD.taboolaInit();
else if (OD.bodyScrollSize() > 1000 && OD.bodyScrollPos() >= .5) OD.taboolaInit();
else if (OD.taboolaTout !== true) {OD.taboolaTout = true; window.setTimeout(function(){OD.taboolaInit();}, 10000);}
}
}
if (!OD.openWebOK){
if (!OD.openWebWidget()) {
OD.openWebOK = true;
} else {
// In viewport, scroll > .5, 15s ?
if (OD.isInViewPort(OD.openWebWidget())) OD.openWebInit();
else if (OD.bodyScrollSize() > 1600 && OD.bodyScrollPos() >= .5) OD.openWebInit();
else if (OD.openWebTout !== true) {OD.openWebTout = true; window.setTimeout(function(){OD.openWebInit();}, 15000);}
}
}

},
// Lazy:Comments
commentsHidderWidget: function(){
if (!OD._commentsHidderWidget) OD._commentsHidderWidget = OD.e('cmtHiddder');
return OD._commentsHidderWidget;
},
commentsWidget: function(){
if (!OD._commentsWidget) OD._commentsWidget = OD.e('postComments');
return OD._commentsWidget;
},
commentsInit: function(){
var script, head = document.head;
OD.commentsOK = true;
script = document.createElement("script");
script.setAttribute("src", "https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.6");
script.setAttribute("async", "false");
script.setAttribute("onload", "FB.XFBML.parse();");
head.insertBefore(script, head.firstElementChild);
},
// Lazy:Taboola
taboolaWidget: function(){
// Desabilitado por conta da MGID
return false;
if (!OD._taboolaWidget) OD._taboolaWidget = OD.e('widgetTaboola');
return OD._taboolaWidget;
},
taboolaInit: function(){
var script, head = document.head;
if (OD.taboolaOK === true) return;
OD.taboolaOK = true;
// 3rd tag
window._taboola = window._taboola || [];
_taboola.push({article:'auto'});
!function (e, f, u, i) {
if (!document.getElementById(i)){e.async = 1; e.src = u;e.id = i;f.parentNode.insertBefore(e, f);}
}(document.createElement('script'), document.getElementsByTagName('script')[0], '//cdn.taboola.com/libtrc/olhardigital/loader.js', 'tb_loader_script');
if(window.performance && typeof window.performance.mark == 'function') {window.performance.mark('tbl_ic');}
},
// Lazy:openWeb
openWebWidget: function(){
if (!OD._openWebWidget) OD._openWebWidget = OD.e('widgetOpenWeb');
return OD._openWebWidget;
},
openWebInit: function(){
if (OD.openWebOK === true) return;
OD.openWebOK = true;
// 3rd tag
!function (e, f, u, i) {
if (!document.getElementById(i)){e.async = 1; e.src = u; e.setAttribute('data-spotim-module', 'spotim-launcher'); e.id = i;f.parentNode.insertBefore(e, f);}
}(document.createElement('script'), document.getElementsByTagName('script')[0], '//launcher.spot.im/spot/sp_ScWcqqRz', 'scriptOpenWeb');
if(window.performance && typeof window.performance.mark == 'function') {window.performance.mark('oweb_prfmrk');}
},
// Lazy:MGID
mgidWidget: function(){
// if (!OD._mgidWidget) OD._mgidWidget = OD.e('M806238ScriptRootC1311647');
if (!OD._mgidWidget) OD._mgidWidget = OD.e('M806238ScriptRootC1501896');
return OD._mgidWidget;
},
mgidInit: function(){
var script, head = document.head;
if (OD.mgidOK === true) return;
OD.mgidOK = true;
// MGID Loader
(function (e, f, u, i) {
if (!document.getElementById(i)){e.async = 1; e.src = u; f.appendChild(e);}
})(document.createElement('script'), document.getElementsByTagName('body')[0], '//jsc.mgid.com/o/l/olhardigital.com.br.1501896.js');
},
// Ajax
getJSON: function(url, data, success, error, complete){
success = success||function(){};
OD.getHTML(url, data, function(responseText){
success(JSON.parse(xhr.responseText));
}, error, complete);
},
getHTML:function(url, data, success, error, complete) {
var xhr = new XMLHttpRequest(),
serialize = function(obj){
var p, str=[];
for (p in obj) {
if (!obj.hasOwnProperty(p)) continue;
str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p]));
}
return str.join("&");
};
xhr.withCredentials = true;
success = success || function() {};
complete = complete || function() {};
error = error || function() {}
xhr.onreadystatechange = function() {
if (xhr.readyState != 4) return;
if (xhr.status == 200) success(xhr.responseText);
else error(xhr.status, xhr.responseText);
complete();
}
xhr.open('GET', url+'&'+serialize(data),true);
xhr.send();
},
// Util
e: function(id){
return document.getElementById(id);
},
isInViewPort: function(element){
var rect, top, bottom;
if (!element) return false;
rect=element.getBoundingClientRect();
top=rect.top;
bottom=rect.bottom;
return (top>=0 && bottom<=window.innerHeight);
},
toggleClass: function(id, className){
var e = OD.e(id);
if (e.classList.contains(className)) {e.classList.remove(className); return false;}
else {e.classList.add(className); return true;}
},
toggleSearch: function(){
if (OD.toggleClass('mainSearch', 'show')) OD.e('mainSearchInput').focus();
},
getUrlParameter: function(name) {
var url = window.location.href.split('?'), vars, upar, i;
url.shift();
vars = unescape(url.join('?')).split('&');
for (i = 0; i < vars.length; i++) {
upar = vars[i].split('=');
if (upar[0] === name) {
if (upar[1] === undefined) return '';
return upar[1].replace(/+/g, ' ');
}
}
return '';
},
// Resfresh
setupPageRefresh: function(){
var seconds = parseInt(OD.e('body').getAttribute('data-refresh'), 10);
if (seconds<=0) return;
window.setTimeout(function(){location.reload();}, Math.max(30,seconds)*1000);
},
// Behaviors
linkTargetPopup: function(e){
var path=e.path||e.composedPath(), link=false, i, w=600, h=600,l,t,coords="";
if (!path) return;
for (i=0; i0 && l>0) coords=",top="+t+','+'left="+l+",screenY='+t+',screenX='+l;
window.open(link.getAttribute('href'),'popup',a="width="+w+',height="+h+coords+",resizable=yes,scrollbars=yes,status=yes,menubar=no');
return false;
}
},
// Cookies
setCookie: function(name, value, expires) {
var d = new Date(), expires;
d.setTime(d.getTime() + (expires*1000));
expires = (expires>0 ? ";expires="+ d.toUTCString() : '');
document.cookie = name+"="+value+expires+";path=/";
},
getCookie: function(name) {
var cname = name+"=", i, c
decodedCookie = decodeURIComponent(document.cookie),
ca = decodedCookie.split(';');
for (i=0; i<ca.length; i++) {
c = ca[i];
while (c.charAt(0)==' ') {c = c.substring(1);}
if (c.indexOf(cname) == 0) return c.substring(cname.length, c.length);
}
return false;
},
hasCookie: function(name){
return OD.getCookie(name)!==false;
},
// Reactions
reactionsWidget: function(){
if (!OD._reactionsWidget) OD._reactionsWidget = OD.e('postReaction');
return OD._reactionsWidget;
},
reactionsInit: function(){
var type = localStorage.getItem('react_'+OD.postID), wdg, counter, btns, btn, b;
if (!(wdg = OD.reactionsWidget())) return;
if (!type) {
btns = wdg.querySelectorAll('button[data-reaction]');
for (b=0; b<btns.length; b++) {
btns[b].addEventListener('click', OD.reactionSelect);
}
return;
}
if (!(btn = wdg.querySelector('button[data-reaction="'+type+'"]'))) return;
counter = btn.querySelector('[data-reaction-counter]');
wdg.setAttribute('data-reacted','yes');
btn.classList.add('selected');
counter.setAttribute('data-reaction-counter', parseInt(counter.getAttribute('data-reaction-counter'),10)+1);
},
reactionSelect: function(){
var btn = this, type = btn.getAttribute('data-reaction'), counter = btn.querySelector('[data-reaction-counter]'), wdg;
if (!type) return;
if (!(wdg = OD.reactionsWidget())) return;
if (wdg.getAttribute('data-reacted')=='yes') return;
localStorage.setItem('react_'+OD.postID, type);
wdg.setAttribute('data-reacted','yes');
btn.classList.add('selected');
counter.setAttribute('data-reaction-counter', parseInt(counter.getAttribute('data-reaction-counter'),10)+1);
OD.getJSON('/wp-admin/admin-ajax.php?action=post_reaction', {post_id:OD.postID,reaction:type});
},
// Navegação reviews
reviewTo: function(target) {
var e = document.querySelector('[data-rvw-bloco="'+target+'"]');
if (e) e.scrollIntoView({behavior: 'smooth', block: 'center'});
},
// play by click
playSingleVideo(target){
var id = target.getAttribute('id');
if (target.getAttribute('data-loaded') == 'yes') return;
target.setAttribute('data-loaded', 'yes');
playerDef = document.getElementById(id+'Object');
if (!playerDef){
target.innerHTML = '

Erro ao reproduzir vídeo: caminho não informado

';
} else if (playerDef.getAttribute('data-type') == 'iframe'){
target.innerHTML = '';
} else {
target.innerHTML = '"';
}
}
};
OD.libraryLoaded();
if (window.OD_bodyAlreadyLoaded===true) OD.bodyLoaded();
document.addEventListener('click', OD.linkTargetPopup, true);

////////////////////////////////////////////////
// OpenWeb
////////////////////////////////////////////////
window.OD.addOnLoad(function(){
// Apenas matérias
if (!OD.postID) return;
// Callbacks
window.openWeb_onNewUnseen = function(count) {
var e = document.getElementById('openWebBellBadge');
if (e){e.innerText = count; e.setAttribute('data-unseen', (count>0 ? 'yes' : 'no'));}
}
window.openWeb_openNotifications = function(){
var payload = {postId: OD.postID, instanceId: "EmbeddedNotifications"};
if (typeof window.__OW_OPEN_NOTIFICATIONS__ === 'function') {
window.__OW_OPEN_NOTIFICATIONS__(payload);
window.openWeb_onNewUnseen(0);
return;
}
document.addEventListener('ow-notifications-sdk-ready', function() {
window.__OW_OPEN_NOTIFICATIONS__(payload);
window.openWeb_onNewUnseen(0);
});
// clicked but not loaded, load now if available
window.OD.openWebInit();
};
// Init
if (typeof window.__OW_SUBSCRIBE_TO_NOTIFICATIONS__ === 'function') {
window.__OW_SUBSCRIBE_TO_NOTIFICATIONS__(OD.postID, window.openWeb_onNewUnseen);
return;
}
document.addEventListener('ow-notifications-sdk-ready', function(){
window.__OW_SUBSCRIBE_TO_NOTIFICATIONS__(OD.postID, window.openWeb_onNewUnseen);
});
});

Sommaire
  1. Les nouvelles options de formatage dans WhatsApp

Frédéric Villeroux

Je partage non seulement la culture culinaire à travers mes mots, mais aussi, je mets en avant les différentes propositions de recettes les plus délicieuses et les astuces pratiques en termes de cuisine. Pour qu’il n’y ait aucune redondance dans les informations que je communique aux lecteurs, je me base sur la rédaction d’article de cuisine, à la pointe de la modernité. Chaque sujet traité sera ainsi de tendance et de nouvelles idées seront mises en ligne au quotidien.

Dans la même catégorie

Go up