Do manuscripts of Vālmīki Rāmāyaṇa and Mahābhārata have footnotes in them?
For example, in Rāmāyaṇa at the end of the war, when Hanumān visits Sītā to relay the news of Rāma's victory, she tells him to spare the lives of Rākṣasi's who'd troubled her earlier, by citing the following story:
अयं व्याघ्रसमीपे तु पुराणो धर्मसंहितः || ६-११३-४४
ऋक्षेण गीतः श्लोको मे तं निबोध प्लवङ्गम |
O Hanuma! There is an old axim possessed of merit, actually uttered by a bear in the presence of a tiger++. Hear it from me.
न परः पापमादत्ते परेषां पापकर्मणाम् || ६-११३-४५
समयो रक्षितव्यस्तु सन्तश्चारित्रभूषणाः |
A superior person does not take into account the sin of those who have committed an offence evil for evil must be carried out at all costs virtuous persons account good conduct as an ornament.
++ Formerly a tiger ran in pursuit of a hunter. The latter climbed up a tree. There was bear already preached on a bough of the tree. Making to the foot of the tree, the tiger addressed the following words to the bear: "Look here, both of us are denizens of the forest. The hunter is our common enemy. Therefore, knock him down from the tree." The bear, however, replied: "Having reached my abode, the hunter has in a way sought asylum with me. I am therefore not going to hurl him down; I would be deviating from my duty if I do so." Saying so, the bear laid himself down to sleep. The tiger now turned to the hunter and said, "Push the bear down. I shall afford protection to you." The hunter thereupon pushed the sleeping bear. The bear, however, clutched at another bough and thus escaped from falling down. The tiger now addressed the following appeal to the bear: "The hunter sought to hurl you down and has thus wronged you. Therefore push him down." Though pressed by the tiger again and again, the bear refused to hurl him down and repeated the above quoted verse in support of his attitude.
But that story is not actually part of Rāmāyaṇa. There are no verses. My guess is Sītā just mentally recollects it but only conveys the summary or final message to Hanumān.
So how did the story survive so many centuries without being written down somewhere?
Or is that story also part of some other scripture and that is how it survived the ages?
Here's how Gorakhpur edition of Rāmāyaṇa also shows the story in footnotes: