Fixed rules for em and strong tags

Now the tags are ignored only if they are surrounded by text or digits.