title: WhatsApp use only html to share url link by a descriptive text
body: <p>I want to enable my website users to share the current web page url (stored in ViewBag.OgUrl) via WhatsApp. </p>
  
  <p>The WhatsApp message should contain the <em>url title</em> (stored in ViewBag.OgTitle) which, when clicked, will open the url (stored in ViewBag.OgUrl).</p>
  
  <p>This needs to be done by html without js.</p>
  
  <p>The standard way is:</p>
  
  <pre><code> @{
      var urlWhatsapp = "whatsapp://send?text=" + @ViewBag.OgUrl;
    }
  </code></pre>
  
  <p>And then simply:</p>
  
  <pre><code> &lt;a href="@urlWhatsapp" target="_blank"&gt;WhatsApp Share&lt;/a&gt;
  </code></pre>
  
  <p>This works fine apart from the fact that the actual url is shared and not the title.</p>
  
  <p>For example, a WhatsApp message contains the actual link <a href="http://example.org/" rel="noreferrer">http://example.org/</a> while I would like it to show in WhatsApp:</p>
  
  <p><a href="http://example.org/" rel="noreferrer" title="First Example">First example</a></p>
  
  <p>Edit: If one wants to get the title and the link just replace the code with:</p>
  
  <pre><code>  @{var urlWhatsapp = "whatsapp://send?text=" + @ViewBag.OgTitle + " - " + @ViewBag.OgUrl;}
  
  &lt;a class="fa fa-whatsapp" href="@urlWhatsapp" target="_blank"&gt;&lt;/a&gt;
  </code></pre>
  
  <p>If one waits after the sharing, but before actually sending the message to the recipient, a clickable box appears above the original message (as would be for any whatsapp link with what is defined in the url - an image, text etc. according - see the example below)
  <a href="https://i.stack.imgur.com/krble.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/krble.jpg" alt="enter image description here"></a></p>