Closed Bug 35380 Opened 20 years ago Closed 20 years ago
Links should not remove Named Anchors
Create or load a file that has at least 1 link and 1 named anchor. Select across both and use Format | Remove Link(s) on the menu. The named anchor should not be removed. The way we implement this is that the string "a" is passed to nsEditorShell::RemoveOneProperty(). It then makes a nsIAtom for "a" and calls nsHTMLEditor::RemoveInlineProperty() In other methods, such as nsHTMLEditor::GetSelectedElement(), where we need to differentiate between a link <a href="foo.html> and a named anchor <a name="foo"> is to pass "href" or "anchor" instead of "a". Unfortunately, this is not possible because RemoveOneProperty takes an nsIAtom. So the simplest solution would seem to be to add these to our atom list: nsIAtom * nsIEditProperty::href; Then RemoveInlineProperty can use this instead of nsIEditProperty::a to do the right thing. We could also add: nsIAtom * nsIEditProperty::namedanchor; but I don't see the need for it. Joe: does this sound reasonable? I could assign this to you, but since it's fairly clear what to do, I thought I'd handle it.
Fix is ready to checkin
Checked in 4/12
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Verifed fixed in my Win32 10/27/00 Netscape_20000922_BRANCH build.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.