Tamar is a woman whose story is told in the Bible, sandwiched between two parts of the story of Joseph. Just when Joseph is resisting the temptation of Potiphar's wife - and being falsely accused of the offense himself, the Book of Genesis interrupts Joseph's story  to describe an episode involving Judah and Tamar. (Genesis 38)Judah's first two sons died without producing an heir. Er was "killed by the Lord" for his wickedness. Onan "spilled his seed" to avoid impregnating his brother's widow. When Tamar saw that Judah was neglecting his promise,
Tamar disguised herself as a harlot and enticed Judah on the road. She demanded three tokens in lieu of payment. Later, Tamar was accused of extramarital sex when her pregnancy became known. Judah was to have her executed,
but Tamar presented the tokens and he had to free her.
it was told Judah, saying, Tamar thy daughter-in-law hath played the harlot; and moreover, behold, she is with child by whoredom. And Judah said, Bring her forth, and let her be burnt. Genesis 38:24 (ASV)
King David was descended from Zarah, one of the twins born to Tamar and Judah.
Views on Tamar
In Unification Church doctrine, Tamar is seen as a righteous woman who cared more about the lineage than about her own life; this is a non-standard theological view.