I'm using Sitecore MVC with Glass Mapper.
When I'm creating a component with a link field, I just add
@Editable(myLink, x=> x.myLinkField)
After setting the links properly on Experience Editor and publishing, it automatically creates the anchor tag with the specified url, class, etc.
I'm wondering where exactly application is creating those attributes and tag. Is this the work of Glass Mapper or any other code?