Use short-links in Publish
For Facebook, Write out full link, after it appears in preview remove the link. Twitter will automatically shorten the link when published
For Facebook:
Step 1: Type the link in the text field and see it appear in the preview, Press Enter
Step 2: Mark and delete the link from the text field
Step 3: The link is still visible in the preview --> Publish the post
What it will looks like on Facebook.com
For Twitter
Twitter will automatically shorten the link and take that into account when calculating how many characters are left of the tweet