I've seen a few posts on this subject, but thought I'd organize it to be more like the stickied post for items.
Your basic format for a spell:
/script DEFAULT_CHAT_FRAME:AddMessage("\124cff71d5ff\124Hspell:SPELLID\124h[Spellname]\124h\124r");
In the red is the color of the spell link, leave this alone. In the SPELLID it's the spell's ID, which is usually found in the URL of any database site. Spellname is just the spell's name.
The name does not matter, it's automatically fixed when you shift click the spell link.
Wowhead: The one thing on which Ninjas and Pirates agree. has added a new feature at the time of posting, where it gives you the script to link the spell. There's no downside to using this at all, since you can't modify spells any further.
Here's the format for a quest link:
/script DEFAULT_CHAT_FRAME:AddMessage("\124cffff2020\124Hquest:QUESTID:QUESTLEVEL\124h[QUESTNAME]\124h\124r");
Leave the color alone. QuestID is the ID from the URL, QUESTLEVEL is the QUEST LEVEL, not required level (available from the database websites). QUESTNAME is the quest's name.
The difference between quests and spells is that the ID, level, and name must all match properly. If any one of them is off, you won't be able to link it.
Once again, you can use WoWhead to get a properly formatted version of the quest you want.
The only editing you can do with the quest is to change its name to a different language. To find the quest's name in other languages, I used the armory (although I'm sure there's a german/spanish/etc WoW DB out there). Find an item that's either a required item (not provided!) or reward, go to the armory, and add this to the end of its URL:
/item-info.xml?i=X
Where X is the itemID of the reward/objective. The quest should be in the item's information. Change the armory's language to whatever you wish (Chinese and Korean don't work on US client), and replace the english name with the new one you get.